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. Win bitmap to QPixmap not working
Forum Updated to NodeBB v4.3 + New Features

Win bitmap to QPixmap not working

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.4k 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.
  • A Offline
    A Offline
    Alexlander
    wrote on last edited by A Former User
    #1

    When I try to convert a windows bitmap to a qt bitmap I get this error:

    unresolved external symbol "_declspec(dllimport) class QPixmap cdecl QtWin::fromHBITMAP(struct HBITMAP *,enum QtWin::HBitmapFormat)" (imp?fromHBITMAP@QtWin@@YA?AVQPixmap@@PEAUHBITMAP@@W4HBitmapFormat@1@@Z) referenced in function "private: void __cdecl Dialog::clicked(void)" (?clicked@Dialog@@AEAAXXZ)

    This is the code:

    		QPixmap winPix = QtWin::fromHBITMAP(hBitmap, QtWin::HBitmapPremultipliedAlpha);
    		winPix.save(&winBuffer, "PNG");
    

    I must be missing something, don't know what though.

    Any help would be appreciated :)

    raven-worxR 1 Reply Last reply
    0
    • A Alexlander

      When I try to convert a windows bitmap to a qt bitmap I get this error:

      unresolved external symbol "_declspec(dllimport) class QPixmap cdecl QtWin::fromHBITMAP(struct HBITMAP *,enum QtWin::HBitmapFormat)" (imp?fromHBITMAP@QtWin@@YA?AVQPixmap@@PEAUHBITMAP@@W4HBitmapFormat@1@@Z) referenced in function "private: void __cdecl Dialog::clicked(void)" (?clicked@Dialog@@AEAAXXZ)

      This is the code:

      		QPixmap winPix = QtWin::fromHBITMAP(hBitmap, QtWin::HBitmapPremultipliedAlpha);
      		winPix.save(&winBuffer, "PNG");
      

      I must be missing something, don't know what though.

      Any help would be appreciated :)

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Alexlander
      did you link against QtWinExtras module?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Alexlander
        wrote on last edited by
        #3

        I just included with #include <QtWinExtras\QtWinExtras>

        raven-worxR 1 Reply Last reply
        0
        • A Alexlander

          I just included with #include <QtWinExtras\QtWinExtras>

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by raven-worx
          #4

          @Alexlander
          I was asking about linking.
          Make sure your pro file contains QT += winextras and rerun qmake before building again

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          A 1 Reply Last reply
          3
          • raven-worxR raven-worx

            @Alexlander
            I was asking about linking.
            Make sure your pro file contains QT += winextras and rerun qmake before building again

            A Offline
            A Offline
            Alexlander
            wrote on last edited by
            #5

            @raven-worx Of course, I was using Qt Tools for windows studio, just had to right click and add a module, thanks!

            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