zoukankan      html  css  js  c++  java
  • QPixmap 和 HBITMAP互转

    Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0);

    声明这一句后, 就可以使用了

    HBITMAP hBmp =  qt_pixmapToWinHBITMAP(pix, 2);

    该函数定义在qpixmap_win.cpp下

    还有一些其他的实用函数

    Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0);
    Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p);
    Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h);
    Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon);

    Qt5.3中可以直接使用

    在qtwinextras/qwinfunctions.h中

    Q_WINEXTRAS_EXPORT HBITMAP toHBITMAP(const QPixmap &p, HBitmapFormat format = HBitmapNoAlpha);
    Q_WINEXTRAS_EXPORT QPixmap fromHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha);

  • 相关阅读:
    内存问题再次注意
    数据分析(基础/数组)
    总结
    scrapy框架
    selenium
    chromedriver设置无界面模式 selenium基础操作
    selenium+phantomjs/Chrome/Firefox
    json解析模块
    cookie模拟登录
    常用正则
  • 原文地址:https://www.cnblogs.com/lingdhox/p/3716086.html
Copyright © 2011-2022 走看看