-
Compare 2 images
Hi!
Need 2 know how to compare 2 images.
Let's say I take a screenshot and puts it in a picturebox named Picture1 using BitBlt.
Then I take a new screenshot, but this time I've opened the Start-Menu. I place the new screenshot in the same picturebox using the SRCINVERT to get the differens from the 2 screens. Everything that was the same becomes black, and the changes get wierd colors. I want to crop the updated area, and get the X and Y coordinate of the top-left corner where it was before getting cropped.
I'm sending this image to another computer and want to have the coordinates, so that the other computer can place the picture at it's old place and so, rebuild the screenshot. I only want to send the little piece that is updated to gain speed.
Anyone who might help me?
-
to me it seems like you got it all figured out. What else do you need?
-
I need to crop the result so I only get the piece that changed. I want to get rid of all the black around.
-
Find out where all the non black spots are. Then find the smallest X, the largest X, the smallest Y, and the largest Y. Take those and turn them into a RECT descriptor, there you have your region.
-
yeah I know, I was thinking about that too, but I guess it would be terribly slow and if you have a round object that changed you will find a wrong place and than you would have to scan backwards the other direction again.
I think that would be pretty slow unless you could convert your data into 256 color pics and than just use copymem to fill an array with the values of the pic.
-
Why would it have that circle problem? It just finds the extreme left, top, right and bottom of the changed pixels...