Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
how to load file.bmp with macro MAKEINTRESOURCE(IDB_BITMAP) with Qt Creator
Domenico last edited by Domenico
Hi Guys, I need advice, which codes can I use to upload a .bitmap file and upload it to MAKEINTRESOURCE (IDB_BITMAP) for the function:
HBITMAP bitMap = (HBITMAP)LoadImageA(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_BITMAP),IMAGE_BITMAP,16,16,LR_LOADFROMFILE);
i tried with: #define IDB_BITMAP 1000
IDB_BITMAP BITMAP "file.bmp"
but it is not possible because Qt creator does not create file resource.rc but resource.qrc which is very different from resource.rc. what codes can I use to automatically load the .bmp file in the macro MAKEINTRESOURCE (IDB_BITMAP)??
thank you for those who help me
Domenico last edited by
I solved the same way:
Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0);
pixmap = pixmap.scaled(16,16);
HBITMAP bitMap = qt_pixmapToWinHBITMAP(pixmap);
thanks all the same for those who wanted to help me!!