Annoying Direct Draw .bmp question.
In a 16-bit color mode, is it possible to load a 256 color .bmp on to a surface, use Surface->GetPalette (or anything for that matter) to get the pal off of it, and then use SetPalette (or anything for that matter) to apply that pal to other surfaces? If I use the DDLoadPalette routine I got from the Dx SDK, I can get the pal okay, but when I try to SetPalette to another surface with it, I get DDERR_INVALIDPIXELFORMAT, and if I try to GetPalette after I''ve loaded the source .bmp I get a DDERR_NOPALETTEATTACHED message. Lil help? If this is the wrong way to go about it, could someone show me another way to get the pal of a .bmp, and apply it to other .bmps?
-F.
"People who chew with their mouths open make me . . . FURIOUS!"
Like fighting games? You'll love FAB:http://www.fenixware.net/fab/index.asp
direct draw loads your 8bit bmp to a 16bit surface. in 16 bits, there is no more palette, all the indices of the palette were replaced with the colors in the indices, and you have to play with your bitmap as a 16bits bitmap.
cyberg
cyberg
cyberg- cyberg_coder@hotmail.com- http://members.xoom.com/cybergsoft
Well you dont need a palette with 16bpp it just takes the color straight from the bitmap. But most bitmaps are not 16bpp (most paint programs dont like 16bpp) so you need to make your bitmaps with 24bpp and then convert it to 16bpp which is not to hard. (its in lamothes book tips of the windows (you know the rest))Good luck email me if you need help at. brdn69@hotmail.com
Brendon Glanzer
EchoSteel
Brendon Glanzer
EchoSteel
I ain''t the brightest 16-bit color mode programmer, but can''t you not fool with palette stuff in 16-bit color? If that''s the case, I''d need to get the palette onto these .bmp''s before I amde surfaces out of them. Would it be feasable to then open the .bmp change the palette data, then re-save it as a temp file, then load the re-saved .bmp onto the surface? I''m not faimiliar with the .bmp format too good, so if someone could offer a hand, I''d be greatful.
-F.
"People who chew with their mouths open make me . . . FURIOUS!"
-F.
"People who chew with their mouths open make me . . . FURIOUS!"
Like fighting games? You'll love FAB:http://www.fenixware.net/fab/index.asp
November 15, 2000 01:28 PM
If you need to monkey with the palette of som picture during runtime, then why not create it as an 8 bit paletted surface instead of a 16 bit surface?
I think there is a way to load a 8bpp bitmap and then convert it to 16bpp but Im not sure. If there is a way to convert from 24bpp to 16bpp there may be a way to convert it back. I dont think you can mess with the palette of a 16bpp bitmap because there isnt one. Im sure if there was a way lamothe would teach it in his book with 8bpp bitmap minipulation.
OoMMMoO
OoMMMoO
Is it possible to load a bitmap onto an 8-bit surface in 16 bit color mode? Or does DDraw only make surfaces that are of the same color depth as the current video mode?
"People who chew with their mouths open make me . . . FURIOUS!"
"People who chew with their mouths open make me . . . FURIOUS!"
Like fighting games? You'll love FAB:http://www.fenixware.net/fab/index.asp
quote:
Is it possible to load a bitmap onto an 8-bit surface in 16 bit color mode? Or does DDraw only make surfaces that are of the same color depth as the current video mode?
You can only make sysmem surfaces that have different color depths, video surfaces have to be the same as the current color depth. So you could load an 8bpp bitmap onto an 8bpp surface, but then you''d have to write your own blitting routine to blit onto 16bpp durfaces. Your blitter wouldn''t copy byte for byte, it would read the source bitmap and each byte would be an index to the palette, the color in the palette is what would be copied over...
This is pretty much useless in 16bpp, it would be slower than just straight blitting and somewhat of a pain to manage some stuff in vram and the rest in sysram. If you want to use palette animations stick to an 8bit display, it will work nicer.
------------
- outRider -
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement