GetPixel / SetPixel Alternatives RRS feed

  • Question

  • User-1369155424 posted
    Hi, I'm looking for some (FASTER) alternatives to the GetPixel / SetPixel methods. I need to replace individual colors in an image with other colors, and need it to happen relatively (not light speed) fast. Get/SetPixel is just rediculously slow. I'm not looking to change saturation, hue, contrast, or anything like that. I need to pinpoint specific colors in an image and change them. I haven't found what I'm looking for with my exhaustive searching, so I'd appreciate any help...thanks! Al
    Tuesday, June 1, 2004 2:13 AM

All replies

  • User122375535 posted
    Use LockBits on the image to get a BitmapData back, then you can access the pixels as a block of bytes. It requires unsafe code, though. Try this tutorial as a starting point: http://www.bobpowell.net/lockingbits.htm Jim ThoughtWorks
    Thursday, June 3, 2004 8:59 AM