Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int
hbitmapFormat = 0);
声明这一句后, 就可以使用了
HBITMAP hBmp = qt_pixmapToWinHBITMAP(pix, 2);
该函数定义在qpixmap_win.cpp下
还有一些其他的实用函数
Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int
hbitmapFormat = 0);
Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap
&p);
Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap,
int w, int h);
Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon);
Qt5.3中可以直接使用
在qtwinextras/qwinfunctions.h中
Q_WINEXTRAS_EXPORT HBITMAP toHBITMAP(const QPixmap &p, HBitmapFormat
format = HBitmapNoAlpha);
Q_WINEXTRAS_EXPORT QPixmap fromHBITMAP(HBITMAP
bitmap, HBitmapFormat format = HBitmapNoAlpha);
时间: 2024-10-07 14:47:12