# Bitmaps....

I have 2 bitmaps. They are almost equals. I need get  the differences between them in a new bitmap, but just the differences. How can I do this?

Thanks.
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Use GetDIBits() to get the bits from the two bitmaps. Then compare cooresponding pixels of the two bitmaps.  There are a variety of ways to compare two pixels.  You might want to see if the two are identical or you might want to see if they are close, you can use

sqrt( (R1-R2)^2 + (G1+G2)^2 + (B1+B2)^2 )

to get an idea of how close two values are.  (R1 is the red value of a pixle from bitmap 1, R2 is the vlaue from bitmap 2, G is for green and B is for blue.)  This value wil be 0 for identical pixels and will get larger as they get more different.
0

Experts Exchange Solution brought to you by