kemege
1st January 2013, 03:17
I'm trying to write a shell extension with Qt 5.0.0, following this tutorial:
http://www.qtcentre.org/threads/32104-howto-making-a-windows-shell-extension-with-qt-open-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:
QImage base;
base.load("./torrent.png");
QPixmap basepix;
basepix.convertFromImage(base);
HBITMAP phbmp = basepix.toWinHBITMAP(QPixmap::PremultipliedAlpha);
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 :confused:
http://www.qtcentre.org/threads/32104-howto-making-a-windows-shell-extension-with-qt-open-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:
QImage base;
base.load("./torrent.png");
QPixmap basepix;
basepix.convertFromImage(base);
HBITMAP phbmp = basepix.toWinHBITMAP(QPixmap::PremultipliedAlpha);
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 :confused: