问题
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 ?
回答1:
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
来源:https://stackoverflow.com/questions/20027290/fromwinhbitmap-is-it-avaialable-in-qt-5-1-1