Rajeshwar
Rajeshwar

Reputation: 11661

fromWinHBITMAP is it avaialable in QT 5.1.1

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

Answers (1)

iPherian
iPherian

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

Related Questions