Bitmap bit1 = new Bitmap( bmpimg , width , height ); Bitmap bit2 = new Bitmap( bmp , width , height ); Bitmap bmpresult = new Bitmap( width
Stride is the number of bytes your code must iterate past to reach the next vertical pixel.
This may be different from the image's width * pixel size if hardware requires a width of a certain multiple.