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. QImage image.save is different from the QPainter.drawImage(image)

QImage image.save is different from the QPainter.drawImage(image)

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.3k Views 1 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.
  • L Offline
    L Offline
    lygstate
    wrote on last edited by lygstate
    #1

    I have a image that generate from QOpenGLFramebufferObject::toImage()
    And the image that I saved to hard driver
    static int count = 0;
    image.save(QStringLiteral("%0.bmp").arg(count++));
    is different from the image the I use QPainter paint to the screen.
    So what's happening?
    The image that saved to hard driver:
    The image that saved to hard driver
    The Image the was drawn to screen:
    The Image the was drawn to screen

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      Hi,

      How do you setup the painter ? Are you doing the any customization of the painter ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        How do you setup the painter ? Are you doing the any customization of the painter ?

        L Offline
        L Offline
        lygstate
        wrote on last edited by
        #3

        None, I have none customize.

        QPainter(this)
        this is a simple pure QWidget.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lygstate
          wrote on last edited by
          #4

          But I found the solution,
          The QImage have invalid Alpha channels, I clean them up.
          And it's works now.

          1 Reply Last reply
          1
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Glad you found out and thanks for sharing !

            Since you have it working now, please mark the thread a solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

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