Code example (I use this for a simple merge and compare function. It takes two images and creates a third grayscale image showing the differences between the two images as a grayscale level. The darker, the greater the difference.):
public static Bitmap Diff(Bitmap src1, Bitmap src2, int x1, int y1, int x2, int y2, int width, int height) { Bitmap diffBM = new Bitmap(width, height, PixelFormat.Format24bppRgb); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) {
Mark post marks LockBits and uses this to modify the image directly in memory. I would suggest looking at this, not what I posted if performance is a problem. Thanks Marc!
mattlant Oct 10 '08 at 7:31 2008-10-10 07:31
source share