Solved

how to compare two bitmaps for equality fast?

Posted on 2009-05-19
1
1,061 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

734 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