【问题标题】:fromWinHBITMAP is it avaialable in QT 5.1.1fromHBITMAP 是否在 QT 5.1.1 中可用
【发布时间】:2013-11-17 04:41:30
【问题描述】:

文档声明该功能可用,但是我收到声明错误

img = QPixmap::fromWinHBITMAP(hRetVal).toImage();

错误是

error C3861: 'fromWinHBITMAP': identifier not found

我试过包括

#include <QPixmap>

但是我仍然得到那个。有什么建议吗?

【问题讨论】:

标签: c++ qt5.1


【解决方案1】:

它被移到 QtWin 命名空间中。

#include <QtWin>

HBITMAP bitmap = ...
QtWin::HBitmapFormat format = ...

QPixmap pixmap = QtWin::fromHBITMAP(bitmap, format);

http://doc.qt.io/qt-5/qtwin.html#fromHBITMAP

【讨论】:

  • 您可能需要像这样包含它:#include ,并在 .pro 文件中添加:“winextras”到 Qt:QT += core gui wineextras
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-10-14
  • 2013-09-14
  • 1970-01-01
  • 1970-01-01
  • 2018-07-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多