The simplest place to start would be dimensions. If the dimensions are not equal, you may be able to declare them false.
If you need to go through them pixel-by-pixel, you'll need two for loops. Something along these lines:
Bitmap ImageA...
Bitmap ImageB...
for ( Int64 x = 0; x < ImageA.Width; x++ )
{
for ( Int64 y = 0; y < ImageA.Height; y++ )
{
if ( ImageA.GetPixel(x, y) != ImageB.GetPixel(x, y) )
{
return false;
}
}
}
It's pseudo-code (the functions exist in C#, although I can't recall them at the moment) and very simplistic, but is how you'd want to perform a basic pixel-to-pixel check.
Note, however, for that loop to work the images must be of the same dimensions. If they aren't, you're likely to get exceptions if you try to sample a pixel outside of the smaller one's area. It also won't be terribly fast to compare the pixels, so you may want to find another way of discarding possible duplicates first.
Edit: I'm not sure how to do this on an Image
, but it is quite simple for Bitmap
s. There isn't a visible way of getting Image pixel data out of the class. It appears the Bitmaps inherit from Images, though, so this may still work. Given that Images are an abstract class for both Bitmaps and Metafiles, they may not have a simple internal pixel list.