Changing a bitmaps colors.

vis781

Well-known member
Joined
Aug 30, 2005
Messages
2,016
Location
Cambridge, UK
Programming Experience
5-10
Hi all, can anyone help me out with this problem.....

I have a bitmap as an embedded resource, and for size reasons i would like to only have this one. So what i would like to do is to be able to change only one of the colors in this bitmap.

For example.... If i had a Blue background with a red cross on it, is it possible to chage just the color of the cross??

If so could anyone give me any pointers, i have a feeling it's got something to do with applying a matrix. But having never used this class before i'm a bit lost.

Thanks.
 
I never tried to do that before, but I guess you could use that matrix idea.
Why don't you paint the image using GDI+, and paint it pixel by pixel. Use two For statements. Use an If clause, so that if you have a pixel colored with color.fromargb(255,255,0,0), you change it to color.fromargb(255,0,0,255). Please give me one week and I'll post the full source code for that.
 
Back
Top