Reputation: 11661
The documents state that the function isavailable however I get an error with the statement
img = QPixmap::fromWinHBITMAP(hRetVal).toImage();
The error is
error C3861: 'fromWinHBITMAP': identifier not found
I tried including
#include <QPixmap>
However I am still getting that . Any suggestions ?
Upvotes: 3
Views: 1281
Reputation: 958
It was moved into the QtWin namespace.
#include <QtWin>
HBITMAP bitmap = ...
QtWin::HBitmapFormat format = ...
QPixmap pixmap = QtWin::fromHBITMAP(bitmap, format);
http://doc.qt.io/qt-5/qtwin.html#fromHBITMAP
Upvotes: 4