Click to See Complete Forum and Search --> : Comparing 2 pictures with graphs.


dev
July 31st, 2001, 11:53 PM
I have 2 pictures in 1 form.
I need to compare the 2 pictures, and plot a graph to show the difference of the 2 pictures.
I could probably compare using pixels, colors or I'm not sure.

Could you provide me the example.
Thank you.

Dev.

shree
August 1st, 2001, 09:23 AM
One method to compare pictures is to use XOR (ROP is vbSrcInvert) as the following examples shows. In the resultant pictures, the parts that were the same result in black.

I'm not sure whether that's what you asked.


private Sub Command1_Click()
Picture1.PaintPicture Picture2.Image, 0, 0, , , , , , , vbSrcInvert
End Sub

private Sub Form_Load()
Picture1.AutoRedraw = true
Picture1.BackColor = vbWhite
Picture1.ScaleMode = 3 'pixels

Picture2.AutoRedraw = true
Picture2.BackColor = vbWhite
Picture2.ScaleMode = 3 'pixels

Picture1.Line (10, 10)-(90, 150), , BF
Picture2.Line (10, 40)-(120, 80), , BF
End Sub