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. HBITMAP to QPixmap in Qt5.0
Qt 6.11 is out! See what's new in the release blog

HBITMAP to QPixmap in Qt5.0

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 4.5k 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.
  • X Offline
    X Offline
    xiaobenshe
    wrote on last edited by
    #1

    How can I conver a HBITMAP to QPixmap in Qt5.0 ?
    I find a function fromWinHBITMAP() in Qt4.8, but this func is not availible in Qt5.0.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      Moved into "Win Extras":http://qt.gitorious.org/qt/qtwinextras
      Build and install then:
      @
      // PRO File
      QT += winextras
      // CPP file
      #include <qwinfunctions.h>
      // Gives you
      // QPixmap Q_WINEXTRAS_EXPORT fromHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha);
      @

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xiaobenshe
        wrote on last edited by
        #3

        where can I find the file <qwinfunctions.h>?
        I cannt find it in Qt5.0, thanks

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          It is part of Win Extras linked above.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            astodolski
            wrote on last edited by
            #5

            is there an alternative to downloading Win Extras? I would like to be able to do this with the what's included in Qt 5.1 without extras.

            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