CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    19

    Comparing 2 pictures with graphs.

    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.


  2. #2
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: Comparing 2 pictures with graphs.

    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





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured