• Advertisement

Archived

This topic is now archived and is closed to further replies.

loading a bitmap

This topic is 6709 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Thanks Zenroth...
it worked with -
szbitmap[] = "gb.bmp"

I don't know why but I had to add .bmp

Share this post


Link to post
Share on other sites
Its because the code in ddutil looks directly at the file name it doesnt add a .bmp extension. The reason youll see just szbitmap[] ="whatever"; in the sdk is because, "whatever" is a bmp stored in the exe as a resource file without the bmp extension. Try it youll see what i mean.

Share this post


Link to post
Share on other sites
Well I tried it as a resource and I still got the same error. It loads the icon file fine, but for some reason it can't load the bitmap.

Share this post


Link to post
Share on other sites
I'm trying to load a bitmap using the same technique that the samples that come with directx use. Examples 4 and 5 do it this same way, and when I run them they work. But when I write my own program I get the DDLoad Bitmap FAILED and I can't figure out why. Here is the code and declarations.

LPDIRECTDRAW4 glpdd;
LPDIRECTDRAWSURFACE4 glpdds1;
static char szbitmap[] "gb";

glpdds1 = DDLoadBitmap(glpdd,szbitmap,0,0);
if(glpdds1 == NULL)
return InitFail(hw,hr,"DDLoadBitmap
FAILED");

"gb" is gb.bmp - 640x480 256 colors.
All help is appreciated. Thanks.

Share this post


Link to post
Share on other sites

  • Advertisement