diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/winextras/qwinfunctions.cpp | 31 | ||||
-rw-r--r-- | src/winextras/qwinfunctions.h | 2 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/winextras/qwinfunctions.cpp b/src/winextras/qwinfunctions.cpp index 7b102a8..7089966 100644 --- a/src/winextras/qwinfunctions.cpp +++ b/src/winextras/qwinfunctions.cpp @@ -69,6 +69,8 @@ Q_GUI_EXPORT HBITMAP qt_createIconMask(const QBitmap &bitmap); Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0); Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0); Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p); +Q_GUI_EXPORT HBITMAP qt_imageToWinHBITMAP(const QImage &imageIn, int hbitmapFormat = 0); +Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0); Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h); Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon); @@ -139,6 +141,22 @@ HICON QtWin::toHICON(const QPixmap &p) } /*! + \since 5.12 + + Creates a \c HBITMAP equivalent of the QImage \a image, + based on the given \a format. Returns the \c HBITMAP handle. + + It is the caller's responsibility to free the \c HBITMAP data + after use. + + \sa imageFromHBITMAP() +*/ +HBITMAP QtWin::imageToHBITMAP(const QImage &image, QtWin::HBitmapFormat format) +{ + return qt_imageToWinHBITMAP(image, format); +} + +/*! \since 5.2 Returns a QImage that is equivalent to the @@ -153,6 +171,19 @@ QImage QtWin::imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height) } /*! + \since 5.12 + + Returns a QImage that is equivalent to the + given \a bitmap. The conversion is based on the specified \a format. + + \sa imageToHBITMAP() +*/ +QImage QtWin::imageFromHBITMAP(HBITMAP bitmap, QtWin::HBitmapFormat format) +{ + return qt_imageFromWinHBITMAP(bitmap, format); +} + +/*! \since 5.2 Returns a QPixmap that is equivalent to the given \a icon. diff --git a/src/winextras/qwinfunctions.h b/src/winextras/qwinfunctions.h index bc07401..fe461d1 100644 --- a/src/winextras/qwinfunctions.h +++ b/src/winextras/qwinfunctions.h @@ -81,7 +81,9 @@ namespace QtWin Q_WINEXTRAS_EXPORT HBITMAP toHBITMAP(const QPixmap &p, HBitmapFormat format = HBitmapNoAlpha); Q_WINEXTRAS_EXPORT QPixmap fromHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha); Q_WINEXTRAS_EXPORT HICON toHICON(const QPixmap &p); + Q_WINEXTRAS_EXPORT HBITMAP imageToHBITMAP(const QImage &image, QtWin::HBitmapFormat format = HBitmapNoAlpha); Q_WINEXTRAS_EXPORT QImage imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height); + Q_WINEXTRAS_EXPORT QImage imageFromHBITMAP(HBITMAP bitmap, QtWin::HBitmapFormat format = HBitmapNoAlpha); Q_WINEXTRAS_EXPORT QPixmap fromHICON(HICON icon); Q_WINEXTRAS_EXPORT HRGN toHRGN(const QRegion ®ion); Q_WINEXTRAS_EXPORT QRegion fromHRGN(HRGN hrgn); |