Guys, which is better ? LoadBitmap() or LoadImage(), i understand LoadImage has more options like specifying the width and height, but how do i store it ?
but an error came out
image = LoadImage(0,MAKEINTRESOURCE(IDB_BITMAP),IMAGE_BITMAP,50,50,LR_VGACOLOR);
And am i using the right value LR_VGACOLOR for resource type.
G:\C++\Task\task.cpp(21) : error C2440: '=' : cannot convert from 'void *' to 'struct HBITMAP__ *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
Since you're using C++ you'll need to cast the return value from HANDLE to HBITMAP using static_cast or the c equivalent if you prefer.
You probably want to use LR_CREATEDIBSECTION as the last parameter to LoadImage. Also you can use 0 for the desired with and height and it will use the actual width and height from resource.
Can you give me an example ? "Since you're using C++ you'll need to cast the return value from HANDLE to HBITMAP using static_cast or the c equivalent if you prefer."
HBITMAP hBitmap = static_cast<HBITMAP>(LoadImage(...));
HBITMAP hBitmap = (HBITMAP)LoadImage(...);