hi buddies..
i wanna need help about
is there possible to compare to images in VB6.
if yes then
can we tell in % ...
like
100 % same
75 % same ......
Printable View
hi buddies..
i wanna need help about
is there possible to compare to images in VB6.
if yes then
can we tell in % ...
like
100 % same
75 % same ......
If you were to compare images of the same size, you would do something like this:
VB Code:
Option Explicit Private Type Picture_Type Size As Long Width As Long Height As Long End Type Private Sub Command1_Click() Dim Pic(1) As Picture_Type Dim X As Long, Y As Long Dim Is_The_Same As Long Dim Comparison As Single With Picture1 .BorderStyle = False .Picture = LoadPicture("C:\Jacob's Stuff\Pics\Alice.jpg") .AutoSize = True .AutoRedraw = True .ScaleMode = 3 End With With Picture2 .BorderStyle = False .Picture = LoadPicture("C:\Jacob's Stuff\Pics\whiterabbit.jpg") .AutoSize = True .AutoRedraw = True .ScaleMode = 3 End With With Pic(0) .Size = Picture1.ScaleWidth * Picture1.ScaleHeight .Width = Picture1.ScaleWidth .Height = Picture1.ScaleHeight End With With Pic(1) .Size = Picture2.ScaleWidth * Picture1.ScaleHeight .Width = Picture2.ScaleWidth .Height = Picture2.ScaleHeight End With If Pic(0).Size = Pic(1).Size Then For Y = 0 To Pic(0).Height - 1 For X = 0 To Pic(0).Width - 1 If Picture1.Point(X, Y) = Picture2.Point(X, Y) Then Is_The_Same = Is_The_Same + 1 End If Next X Next Y Comparison = (Is_The_Same / Pic(0).Size) * 100 MsgBox "Both images are " & Comparison & "% the same", vbInformation Else MsgBox "The pictures are not the same size, so no comparison will be made.", vbCritical End If
That's funny. Deja Vu :bigyello:
Well, sure, if they're the same size, and color depth, then you could. You could also mask them both to get a more accurate view. In the other thread they said that the images were different sizes.
Thanks RhinO
but i want to compare two pictures in very real sense.
like
Picture is same ...
but One is coloured
and other is Black & White ..
So when i will compare program should say that pictures LOOK TO BE SAME
I do not want to compare COLORS only ....:wave:
Rhino? :ehh:
I'd like to mention that if the image was offsetted by as much as one pixel, Jake's approach will likely say it's very different(especially if JPG, since the actual pixels aren't the same even if they were before compression).