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. Image within an Image, can it be done ?
Forum Updated to NodeBB v4.3 + New Features

Image within an Image, can it be done ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 2.1k Views 3 Watching
  • 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.
  • N Offline
    N Offline
    Nevering
    wrote on last edited by
    #1

    A little help please ..

    I have a rather unique situation and want to find out if it can be done. I've been told by one QT programmer that it can't I wanted to check with the experts.

    I would like to be able to display a legal form image within a window for people to edit fields upon. There is an area at the on the page that requires a barcode that is created just before printing and combined with the form on print out to look like one image (the barcode contains data that is filled in on the form) .. a flattening of the images on printing. Prior to printing a dummy barcode is used as a place holder, then at printing the real one is generated and combined with the form image and printed.

    If this can be done, suggestions would be helpful.

    thanks

    1 Reply Last reply
    0
    • N Offline
      N Offline
      Nevering
      wrote on last edited by
      #2

      A short example of what I mean... The background "Current Inventory" being one image, while the barcode is another.0_1473197264253_barcode.jpg

      1 Reply Last reply
      0
      • kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #3

        Please upload your image to an external site (e.g. postimage.org). The image upload here on the forums isn't working properly. Thanks.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        1
        • N Offline
          N Offline
          Nevering
          wrote on last edited by
          #4

          Image uploaded there https://postimg.org/image/javwr1gaz/

          kshegunovK 1 Reply Last reply
          0
          • N Nevering

            Image uploaded there https://postimg.org/image/javwr1gaz/

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by kshegunov
            #5

            @Nevering
            Thanks!
            You can draw one image over another image no problem. Just use the first QImage as a surface for QPainter and draw the second image on top of it with one of the QPainter::drawImage overloads.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            2
            • N Offline
              N Offline
              Nevering
              wrote on last edited by
              #6

              do you know of any example code for this ?

              thanks

              1 Reply Last reply
              0
              • kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by
                #7

                Well, no, but Qt's examples are always a good place to start. An image is a paint device as any window, so anything you can draw on a window with the painter you can draw onto an image. Take a look here and here for the actual examples.

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                3
                • N Offline
                  N Offline
                  Nevering
                  wrote on last edited by
                  #8

                  A comment. I understand that I can subclass a widget, however it seems kind of strange coming from a windows c++ C# background using a "Widget" as a drawing/image surface. I guess I just maybe it's just a terminology thing, but it would seem that having an image view would be more appropriate ... :)

                  1 Reply Last reply
                  0
                  • mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Hi
                    While it would be easy to make an Image View widget as seen in c# and friends, its not
                    really needed and soon you be painting to the printer in same manner so at that
                    time I guess it will make more sense. :)

                    1 Reply Last reply
                    1

                    • Login

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