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. Which format to use for efficient QImage to QPixmap conversion?
Forum Updated to NodeBB v4.3 + New Features

Which format to use for efficient QImage to QPixmap conversion?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 288 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.
  • S Offline
    S Offline
    Simmania
    wrote on last edited by
    #1

    Hi,
    I would like to create an QImage from scratch and convert it to a QPixmap to show it on screen.
    Which QImage format should I use to make the conversion to QPixmap fast?
    I guess I need to use the native screen format. But how can I find that out?

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

      Hi,

      Which operations will you be doing to your QImage ? Depending on that, it might be possible to do them directly on the pixmap.

      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
      • S Offline
        S Offline
        Simmania
        wrote on last edited by Simmania
        #3

        I want to fill in the pixels with some algorithm. It must be pixel accurate. And then draw the resulting image (possibly stretched) onto the screen.
        I prefere not to use painter functions for this to get maximum speed. Unless the transfer from image to pixelmap takes a lot of time, then maybe drawing to pixmap is faster. But I have to fill in the pixels one by one. So writing to a char array will be faster.

        And I had problems painting to the screen directly before (see some other posts). To avoid this kind of problems (like scaling) I think it is better to not paint to a pixmap because that probably adapts to the screen too.

        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