I need to compare if 2 bitmaps are the same.
Is there an easier way to accomplish this?
Is there an easier way to accomplish this?
B4X:
Sub ImageAreSame(bitmap1 As B4XBitmap, bitmap2 As B4XBitmap) As Boolean
Dim bc1 As BitmapCreator
bc1.Initialize(bitmap1.Width,bitmap1.Height)
bc1.CopyPixelsFromBitmap(bitmap1)
Dim bc2 As BitmapCreator
bc2.Initialize(bitmap1.Width,bitmap2.Height)
bc2.CopyPixelsFromBitmap(bitmap2)
Dim x, y As Int
Dim ARGB1, ARGB2 As ARGBColor
For x = 0 To bc1.mWidth-1
For y = 0 To bc1.mHeight-1
bc1.GetARGB(x, y, ARGB1)
bc1.GetARGB(x, y, ARGB2)
If ARGB1<>ARGB2 Then Return False
Next
Next
Return True
End Sub