Changing pixels in a bitmap

  • Thread starter Thread starter Joshua Moore
  • Start date Start date
J

Joshua Moore

My version of transparency for compact framework is the code below. It
checks each pixel for a color, and if it finds it, it replaces it. Please
tell me someone can do this faster, as it takes 3 LONG seconds to do the
current code, and looks quite out of place.

Thanks,
Joshua Moore

for(int i=0; i < 529; i++)
{
int x = (i%23);
int y = (i/23);
if (star.GetPixel(x,y) == oldColor)
{
star.SetPixel(x, y, CardForm.cardColor);
}
}
 
Sorry all...I realized why the SetColorKey wasn't working (transparency).
Why so many on this board complain about transparency if they'd realize
imported graphics can use:

Imaging.ImageAttributes ia = new Imaging.Attributes()
ia.SetColorKey(Color.Transparent, Color.Transparent)
 
Back
Top