Solved

how to compare two bitmaps for equality fast?

Posted on 2009-05-19
1
1,041 Views
Last Modified: 2013-11-22
Hi, I have two bitmaps both 19px wide and 54px high..Just want to know if they are the same visually or not..I am currently using scanline looping through both bitmaps till i find different pixels or else they are the same..but i read somewher that this approach is slow relative to what is possible..How can I use GetDIbits for this purpose?
thanks
0
Comment
Question by:Alavna
1 Comment
 
LVL 4

Accepted Solution

by:
irishbuddha earned 500 total points
ID: 24424277
From EFGs Reference Library: http://www.efg2.com

http://www.efg2.com/Lab/Library/UseNet/2002/0114.txt
"Andrew Rybenkov's UseNet Post       about using GetDIBits/SetDIBits as an alternative to Scanline"

You end up using a PColorArray as seen in the example (array of TColorRec, describing each pixel).

Given the types defined there, and using that sample, you can then compare the arrays "pixel by pixel" via the TColorRec byte properties for equaltiy, bailing on your first inequality.

Don't have any personal code, but this has been a great reference site for me in the past and the code is pretty lean.


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now