Save Graphic scene in Database
-
Hello
i have a qgraphic scene and a picture in Graphicview
The picture provide in Pixmap for Graphicview
and with scene user can draw line on picturebut i want save and Retrieve image and drawing Lines in SqlServer Database
What i must Do ?
-
Hi
this show to save load image to db
https://wiki.qt.io/How_to_Store_and_Retrieve_Image_on_SQLitefor the lines, u need to store x1,y1,x2,y2 and maybe color etc.
-
@M4RZB4Ni
just image unless you change the actual image but
if you use the normal line object, you must handle that besides the images.
(as its not part of the image) -
@M4RZB4Ni
well , is that not just 4 ints/floats ?
for start x,y and end x,y ?
You need to save color or anything else?u can use
http://doc.qt.io/qt-5/qgraphicslineitem.html#lineto get the points.
-
@M4RZB4Ni
ok, if that is what u wish.
The lines will no be lines then , when u load it again.
they will be part of imageEverything u need for screen capture is here
http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html -
@M4RZB4Ni
hi
the core is
originalPixmap = screen->grabWindow(0);ยจso you can grab any widget or window this way.
If you need only a subset of widget, then grab whole widget
and cut the pixmap to the wanted size using
http://doc.qt.io/qt-4.8/qpixmap.html#copy
9/12