Public Class Form1
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If Not PictureBox1.Image.Height = PictureBox2.Image.Height Or Not PictureBox1.Image.Width = PictureBox2.Image.Width Then
Form2.Show()
Else
Dim bmp1 As New Bitmap(PictureBox1.Image)
Dim bmp2 As New Bitmap(PictureBox2.Image)
Dim bmp3 As New System.Drawing.Bitmap(PictureBox1.Image.Height, PictureBox1.Image.Width)
For x As Integer = 1 To PictureBox1.Image.Width
For y As Integer = 1 To PictureBox1.Image.Height
Dim p0 As Drawing.Color = bmp1.GetPixel(x, y)
Dim p1 As Drawing.Color = bmp2.GetPixel(x, y)
If Not p0 = p1 Then
bmp3.SetPixel(x, y, Color.Red)
Else
bmp3.SetPixel(x, y, Color.Black)
End If
Next
Next
PictureBox3.Image = New Bitmap(bmp3)
End If
End Sub
End Class