Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Save Graphic scene in Database
QtWS25 Last Chance

Save Graphic scene in Database

Scheduled Pinned Locked Moved Solved General and Desktop
graphics scenedatabasesave
12 Posts 2 Posters 4.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    M4RZB4Ni
    wrote on 22 Aug 2016, 09:42 last edited by
    #1

    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 picture

    but i want save and Retrieve image and drawing Lines in SqlServer Database

    What i must Do ?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 22 Aug 2016, 09:53 last edited by
      #2

      Hi
      this show to save load image to db
      https://wiki.qt.io/How_to_Store_and_Retrieve_Image_on_SQLite

      for the lines, u need to store x1,y1,x2,y2 and maybe color etc.

      M 1 Reply Last reply 22 Aug 2016, 10:00
      1
      • M mrjj
        22 Aug 2016, 09:53

        Hi
        this show to save load image to db
        https://wiki.qt.io/How_to_Store_and_Retrieve_Image_on_SQLite

        for the lines, u need to store x1,y1,x2,y2 and maybe color etc.

        M Offline
        M Offline
        M4RZB4Ni
        wrote on 22 Aug 2016, 10:00 last edited by
        #3

        @mrjj
        thanks
        but this save lines has been drawn in scene ?
        or jsut save the pic?

        M 1 Reply Last reply 22 Aug 2016, 10:07
        0
        • M M4RZB4Ni
          22 Aug 2016, 10:00

          @mrjj
          thanks
          but this save lines has been drawn in scene ?
          or jsut save the pic?

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 22 Aug 2016, 10:07 last edited by
          #4

          @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)

          M 1 Reply Last reply 22 Aug 2016, 10:10
          1
          • M mrjj
            22 Aug 2016, 10:07

            @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)

            M Offline
            M Offline
            M4RZB4Ni
            wrote on 22 Aug 2016, 10:10 last edited by
            #5

            @mrjj
            thanks again
            can you help me how i can save that normal lines?

            M 1 Reply Last reply 22 Aug 2016, 10:18
            0
            • M M4RZB4Ni
              22 Aug 2016, 10:10

              @mrjj
              thanks again
              can you help me how i can save that normal lines?

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 22 Aug 2016, 10:18 last edited by mrjj
              #6

              @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#line

              to get the points.

              M 1 Reply Last reply 22 Aug 2016, 12:24
              1
              • M mrjj
                22 Aug 2016, 10:18

                @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#line

                to get the points.

                M Offline
                M Offline
                M4RZB4Ni
                wrote on 22 Aug 2016, 12:24 last edited by
                #7

                @mrjj
                i think its better to capture screenshot from that pic and lines
                how can i capture screenshot from x,y location?

                M 1 Reply Last reply 22 Aug 2016, 12:41
                0
                • M M4RZB4Ni
                  22 Aug 2016, 12:24

                  @mrjj
                  i think its better to capture screenshot from that pic and lines
                  how can i capture screenshot from x,y location?

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 22 Aug 2016, 12:41 last edited by mrjj
                  #8

                  @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 image

                  Everything u need for screen capture is here
                  http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html

                  M 1 Reply Last reply 22 Aug 2016, 12:47
                  1
                  • M mrjj
                    22 Aug 2016, 12:41

                    @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 image

                    Everything u need for screen capture is here
                    http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html

                    M Offline
                    M Offline
                    M4RZB4Ni
                    wrote on 22 Aug 2016, 12:47 last edited by
                    #9

                    @mrjj
                    thanks
                    i saw this example
                    but this capture all of screen!
                    i want to capture Particular points!
                    How should i do this?

                    M 1 Reply Last reply 22 Aug 2016, 12:57
                    0
                    • M M4RZB4Ni
                      22 Aug 2016, 12:47

                      @mrjj
                      thanks
                      i saw this example
                      but this capture all of screen!
                      i want to capture Particular points!
                      How should i do this?

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 22 Aug 2016, 12:57 last edited by
                      #10

                      @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

                      M 2 Replies Last reply 22 Aug 2016, 13:53
                      1
                      • M mrjj
                        22 Aug 2016, 12:57

                        @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

                        M Offline
                        M Offline
                        M4RZB4Ni
                        wrote on 22 Aug 2016, 13:53 last edited by
                        #11
                        This post is deleted!
                        1 Reply Last reply
                        0
                        • M mrjj
                          22 Aug 2016, 12:57

                          @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

                          M Offline
                          M Offline
                          M4RZB4Ni
                          wrote on 22 Aug 2016, 14:03 last edited by
                          #12

                          @mrjj
                          Thanks a lot Brother :)
                          My Problem Solved!

                          1 Reply Last reply
                          1

                          6/12

                          22 Aug 2016, 10:18

                          • Login

                          • Login or register to search.
                          6 out of 12
                          • First post
                            6/12
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved