I use the following code to get mouse cursor bitmap:
HCURSOR hCursor = (HCURSOR)LoadImage(NULL, IDC_ARROW, IMAGE_CURSOR, 0, 0, LR_SHARED | LR_DEFAULTSIZE);
ICONINFO info = { 0 };
BOOL ret = GetIconInfo(hCursor, &info);
When I save the info.hbmMask
bitmap to a file, it looks like this:
I want to use this cursor as a Direct3d9 texture for drawing. I do not know how to convert this monochrome bitmap into an RGB byte buffer which can be used for creating the texture.
Or is there any other way to get an RGB byte array of a standard Windows cursor?
GetDIBits
to extract the bits from a bitmap.