Hi guys,
I just needed an 'is_same_bitmap' function (compares only the image data of the bitmap and ignores alpha [suitable for the purpose I had in mind])
I wrote the following which when using memory bitmaps is perfectly fast for my purposes (it's a one off conversion job rather than a critical run-time process) but I'm always keen to know of improvements I can make to code. So, here is my code and I'd welcome any suggestions for optimization or how you might write the same function.
Thank you,
Stan
You can speed things up by locking the bitmaps. Also, if you do lock them you can compare them line-by-line like so:
How often do you do this twice? That is, the same bitmap will be checked twice? And how often are the bitmaps changed? Because it might be useful to just calculate hashes for them (going pixel by pixel once per bitmap) and then compare the hashes.