Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to compare two bitmaps for equality fast?

Posted on 2009-05-19
1
Medium Priority
?
1,087 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 1500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Loops Section Overview
Suggested Courses

971 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