fromWinHBITMAP is it avaialable in QT 5.1.1

若如初见. 提交于 2020-01-15 01:25:10

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!