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

## Recommended Posts

It's been a long time since I had the chance to work on my private project. At the moment, I load a base image, change a certain range of palette entries(8), update the palette and then load it bitmap as a Texture. However, in my executable, the original bitmap shows up, even tho I changed the palette. This is my code:
            Color c = Color.Green;
System.Drawing.Imaging.ColorPalette pal = b.Palette;

for (int i = 0; i < 7; ++i)
{
int red = (int)(c.R * (8.0 - i) / 8.0);
int green = (int)(c.G * (8.0 - i) / 8.0);
int blue = (int)(c.B * (8.0 - i) / 8.0);

pal.Entries[142 + i] = Color.FromArgb(0xff, red, green, blue);
}
b.Palette = pal;
b.MakeTransparent(transparancy);

t = new Texture(engine.Device, b, Usage.None, Pool.Managed);


I don't understand why it doesn't update the palette. It doesn't matter if I change b.Palette.Entries or in pal, it bitmap doesn't show up with changed colors. My question is: Why is this? And how can I force the bitmap to update it's palette? I tried this in an application that used a picturebox, and apparantly, it works fine there... Toolmaker

##### Share on other sites
It's been a while and I forgot this thread. Ideas?

• 23
• 10
• 19
• 15
• 14