-
1 Attachment(s)
Loading bitmaps...
Hi all!
I'm trying to load a 256 color bitmap with the following code, but it doesn't look good at all! The bitmap is painted over the system bar and has two black lines going throug it....was it wrong...???
Any help would be appriciated! :)
BTW: Is there an esiaer way to do it??
-
u could use use loadpicture.
oops, didnt see it was c++, ud have to use loadbitmap(). check it out at www.winprog.org
-
Hehe, Mushroom :D You didn't even look at the post did ya :)
Carsten, the way I look at it is you have two choices - now I know I suck at C++, and you might not, but check every little detail in the loading section. You'll be surprised at the stuff you missed yesterday that you won't, for example, today.
The other thing I can think of is loading using DirectDraw's internal bitmap loader. Just look up a DirectX resource site and implement its way of loading. It should work for 8-bit bitmaps with a flag.
That's all I can think of, I hope you figure it out! Best of luck!
-
My internet is so slow that i try not to download something unless i really have to.
-
-
-
But there is something wrong....I can load a 640x480 picture just fine, but when I load a smaller one, it goes berskerk...???
-
Huh??? Hmm, Ill take a look at it and see where the problem is
-
Your code does some weird stuff, my only guess is that your other bitmaps are perhaps less than 8bits. Make sure all your bitmaps are 8bit or 16 bit. Other than that, I would suggest you use the DDLoadBitmap function in the ddutil.h file that comes with DirectX SDK.
-
Thanks :)
Does it work in the same way?
-
It works better man, it can load any number of bits per pixel and i think it will convert it for you... anyways, it returns a directdrawsurface object so you dont have to worry about all of the nasty bitmap loading functions, it does that all.
-
Great! Of so glad that I finally can get rid of all those nasty functions!
Thanks ;)
-
I can't find the function....
-
1 Attachment(s)
Here is my functions:
just #include the .h and make sure to change the .cpp to include the following:
<ddraw.h>
<windows.h>
and anything else it might need, the stdhdr.h file is a precompiled header that contained all of those plus more stuff not specific to directdraw...
-
Uhhh very confusin code...could you give an example....
-
Heheh, lol
OK
PHP Code:
#include "ddutil.h"
LPDIRECTDRAWSURFACE ThePic;
// lpDD is pointer to DirectDraw object
ThePic = DDLoadBitmap (lpDD, "MyPic.bmp", 0, 0);
// Now ThePic contains the surface that holds mypic.bmp
// you can blit and whatnot, bla bla bla
-