Archived

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

nvissing

applying new color data to a texture from a palettized bitmap?

Recommended Posts

Can anyone come up with a good solution to this problem: i have a dx9 texture in the format A1R5G5B5 i have a palette entry with 256 colors in the format A8R8G8B8 and i also have the color indexed bitmap data from an 8 bit bitmap. i have created a texture using the D3DXCreateTextureFromFileEx() and added the palette to the texture. This works fine. Now i want to change my palette to for example a grayscale palette and map it over the texture, and here comes the problems. Supposly i could loop through my bitmap data, look up the color index in my new palette and create the correct 1555 color format and write it directly down in the texture, but since the texture automatically has size power of 2 it does not match my original bitmap size and it screws up. Does any one have a good solution for this ? Thanks in advance. Niels

Share this post


Link to post
Share on other sites