Results 1 to 4 of 4

Thread: QPixmap::toWinHBITMAP missing on windows

  1. #1
    Join Date
    Dec 2012
    Location
    Shanghai
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QPixmap::toWinHBITMAP missing on windows

    I'm trying to write a shell extension with Qt 5.0.0, following this tutorial:
    http://www.qtcentre.org/threads/3210...source-edition

    and since I'd like to create file thumbnails with this extension, I need to write this IThumbnailProvider::GetThumbnail method, whose definition is :HRESULT GetThumbnail( [in] UINT cx, [out] HBITMAP *phbmp, [out] WTS_ALPHATYPE *pdwAlpha );
    So I have to convert my image into a HBITMAP.

    I googled and find a method QPixmap::toWinHBITMAP().
    My code is:
    Qt Code:
    1. QImage base;
    2. base.load("./torrent.png");
    3. QPixmap basepix;
    4. basepix.convertFromImage(base);
    5. HBITMAP phbmp = basepix.toWinHBITMAP(QPixmap::PremultipliedAlpha);
    To copy to clipboard, switch view to plain text mode 
    but when I tried to use it, I found that this wasn't defined. QPixmap::fromWinHBITMAP() is not defined as well, although I did find it in the Qt Help on my computer.

    Please help

  2. #2
    Join Date
    Jan 2009
    Location
    The Netherlands and Spain
    Posts
    150
    Thanks
    6
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QPixmap::toWinHBITMAP missing on windows

    Did you notice it's only available on Windows?

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QPixmap::toWinHBITMAP missing on windows

    I'm sure kemege did notice that given the title of the post. The function is not declared in the Qt5 QPixmap header, and only appears in the doc comments of the cpp file AFAICT (I grepped the source). This would be consistent with kemege's observation that the function is MIA.

    The function was removed a long time ago by commit bc0a028
    Get rid of some obsolete functions in QImage / QPixmap / QPixmapData.
    It's not clear the reasoning or proposed alternative.

  4. #4
    Join Date
    Dec 2012
    Location
    Shanghai
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPixmap::toWinHBITMAP missing on windows

    Quote Originally Posted by ChrisW67 View Post
    I'm sure kemege did notice that given the title of the post. The function is not declared in the Qt5 QPixmap header, and only appears in the doc comments of the cpp file AFAICT (I grepped the source). This would be consistent with kemege's observation that the function is MIA.

    The function was removed a long time ago by commit bc0a028

    It's not clear the reasoning or proposed alternative.
    Thank you for your reply, ChrisW67
    Maybe I'll have to find some other ways to get a HBITMAP...... such as save it to a file and use LoadImage() to get a HBITMAP.

Similar Threads

  1. Trouble with QPixmap in windows 8.
    By Rodrigo Alves in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2012, 00:28
  2. Windows 7 and QPixmap
    By GimpMaster in forum Qt Programming
    Replies: 4
    Last Post: 23rd February 2010, 19:36
  3. Missing doc\html directory after Windows Vista 4.5.3 install (LGPL)
    By rtc1 in forum Installation and Deployment
    Replies: 0
    Last Post: 10th October 2009, 21:47
  4. QPixmap missing picture
    By dognzhe in forum Qt Programming
    Replies: 6
    Last Post: 27th July 2009, 09:01
  5. Replies: 7
    Last Post: 29th January 2009, 19:47

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.