Change color in bitmap

Hi,

I need to change Black color to White color in bitmap that created from array of pixels.

Thank's
Alexei

[117 byte] By [Alexei_shk] at [2007-12-16]
# 1

Try this:



Bitmap b = new Bitmap(image);

for (int x=0; x<b.Width; x++)
{
for (int y=0; y<b.Height; y++)
{
Color pixel = b.GetPixel(x, y);
if ( pixel.Equals(Color.Black) )
{
b.SetPixel(x, y, Color.White);
}
}
}



-chris

gwapo at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
Hi,

I know about this solution but it slow...

Thank's
Alexei

Alexei_shk at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3
Try the direct integer approach, discussed here:
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=61604

-chris

gwapo at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...