Solved

how to compare two bitmaps for equality fast?

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dev Express grid collapse 2 47
Delphi inherited method 6 80
Twebbrowser in Fire monkey android scrolling to bottom 1 68
can i put an image from resource into image tag ? 6 32
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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