Those are identical, because they are in fact the exact same file. They both link to the same place. It is possible that both your bitmaps contain exactly the same number of colors and pixels (though not exactly in the same place).
There's a much quicker, easier, way to compare two identically sized bitmaps if all you want to do is know whether they are different or not - just compare the MD5 checksum of the bitmap files themselves. Use the Hash library and compare the MD5 checksum of each bitmap. If the images are different the MD5 hash will differ. If they are identical the MD5 hash of the bitmap files will be identical. You can download the Hash library here:
http://www.mjtnet.com/plugins.htm
Here's an example that compares the two bitmap files:
Code: Select all
//Get MD5 hash of a file
LibFunc>d:\Hashlib,FileMD5,r1,D:\img\screen.bmp,buf1
Mid>r1_2,1,r1,hash1
//Get MD5 hash of a file
LibFunc>d:\Hashlib,FileMD5,r2,D:\img\screen2.bmp,buf2
Mid>r2_2,1,r2,hash2
If>hash1=hash2
MessageModal>Bitmap files are identical
else
MessageModal>Bitmap files are different
Endif
A precise graphical comparison is slower, but can be achieved with the GetRectCheckSum commands. This works directly off the screen and allows you to define a rectangular portion of the screen and get a checksum back based on the position/color of each pixel.