LoadImage (... LR_CREATEDIBSECTION...)

If I load an image via LoadImage() setting fuLoad to LR_CREATEDIBSECTION it creates a 'DIB section bitmap'. How do I find out the information of this bitmap? (As using GetObject doesn't *seem* to work).

Do I treat the bitmap returned from LoadImage the same as I would a DDB (Except for the top down rendering)?

EDIT: Also it appears that SelectObject(hdc, DIBitmap) doesn't seem to work either, though I am not positive.
Last edited on
(As using GetObject doesn't *seem* to work).


Can you be a bit more specific?
What does LoadImage return?
What does GetObject() return?

Could you post your code?
hBitmapPrimary = (HBITMAP)LoadImage(NULL, MAKEINTRESOURCE(IDB_PRIMARY), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE | LR_CREATEDIBSECTION);

Anything code after this with a break point is skipped. I cannot use GetLastError, or as I say does it break on GetObject or SelectObject, yet it does *sometimes* put the image into the HDC.

1
2
3
4
hBitmapPrimaryPrevious = (HBITMAP)SelectObject(hdcPrimary, hBitmapPrimary);
		GetObject(hBitmapPrimary, sizeof(BITMAP), &bmpResource);
		cxPrimary = bmpResource.bmWidth;
		cyPrimary = bmpResource.bmHeight;


Can you upload the complete project somewhere?
Topic archived. No new replies allowed.