怎么用vb找出两副图片不不同之处?
我是vb初学者,在网上看到下面的代码,不懂怎么用,请高手指教。
还有我的vb6.0好像没有cDIB这数据类型,这个数据类型怎么定义?
或者有什么其它好的对比方法?
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (lpPrevWndFunc As Any, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private AsmCode(46) As Byte
Private Sub InitAsmCode()
If AsmCode(0) <> &H55 Then
AsmCode(0) = &H55
AsmCode(1) = &H8B
AsmCode(2) = &HEC
AsmCode(3) = &H8B
AsmCode(4) = &H55
AsmCode(5) = &H10
AsmCode(6) = &H85
AsmCode(7) = &HD2
AsmCode(8) = &H76
AsmCode(9) = &H21
AsmCode(10) = &H8B
AsmCode(11) = &H45
AsmCode(12) = &HC
AsmCode(13) = &H8B
AsmCode(14) = &H4D
AsmCode(15) = &H8
AsmCode(16) = &H56
AsmCode(17) = &H57
AsmCode(18) = &H8B
AsmCode(19) = &H31
AsmCode(20) = &H8B
AsmCode(21) = &H38
AsmCode(22) = &H3B
AsmCode(23) = &HF7
AsmCode(24) = &H75
AsmCode(25) = &H6
AsmCode(26) = &HC7
AsmCode(27) = &H0
AsmCode(28) = &H0
AsmCode(29) = &H0
AsmCode(30) = &H0
AsmCode(31) = &H0
AsmCode(32) = &H83
AsmCode(33) = &HC1
AsmCode(34) = &H4
AsmCode(35) = &H83
AsmCode(36) = &HC0
AsmCode(37) = &H4
AsmCode(38) = &H4A
AsmCode(39) = &H75
AsmCode(40) = &HE9
AsmCode(41) = &H5F
AsmCode(42) = &H5E
AsmCode(43) = &H5D
AsmCode(44) = &HC2
AsmCode(45) = &H10
AsmCode(46) = &H0
End If
End Sub
Public Function ImgCompare(SrcData As cDIB, DestData As cDIB) As Boolean
Call InitAsmCode
CallWindowProc AsmCode(0), SrcData.ImagePtr, DestData.ImagePtr, SrcData.mWidth * SrcData.mHeight, 0
ImgCompare = True
End Function