I figured it out. The loaded images had to be loaded as Bitmaps.
vb Code:
Dim img, imgFile As Bitmap img = Image.FromFile(strTemp.Trim & ".jpg", True)
Then I wrote a function that compared the two images.
vb Code:
Function CompareImages(ByVal imgA As Bitmap, ByVal imgB As Bitmap) As Boolean Dim WidthA, WidthB, HeightA, HeightB As Integer Dim i, j As Integer Dim flag As Boolean widthA = imgA.Width widthB = imgB.Width heightA = imgA.Height HeightB = imgB.Height flag = True If WidthA = WidthB AndAlso HeightA = HeightB Then For i = 0 To WidthA - 1 For j = 0 To HeightB - 1 If imgA.GetPixel(i, j) <> imgB.GetPixel(i, j) Then flag = False i = WidthA j = HeightA End If Next Next Else flag = False End If CompareImages = flag End Function




Reply With Quote