Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim openfile As New OpenFileDialog
If openfile.ShowDialog = Windows.Forms.DialogResult.OK Then
PictureBox1.Image = Image.FromFile(openfile.FileName)
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim openfile As New OpenFileDialog
If openfile.ShowDialog = Windows.Forms.DialogResult.OK Then
PictureBox2.Image = Image.FromFile(openfile.FileName)
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim result As Boolean = False
Dim BMP1 As New Bitmap(PictureBox1.Image)
Dim BMP2 As New Bitmap(PictureBox2.Image)
Dim total_checked As Integer
Dim total As Integer
total = 250 * 250
For x As Integer = 0 To (250) - 1
For y As Integer = 0 To (250) - 1
If BMP1.GetPixel(x, y).Equals(BMP2.GetPixel(x, y)) Then
total_checked = total_checked + 1
If total_checked = total Then
result = True
End If
Else
result = False
End If
Next
Next
End Sub
End Class