Solved

how to compare two bitmaps for equality fast?

Posted on 2009-05-19
1
1,034 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

20 Experts available now in Live!

Get 1:1 Help Now