Spacetech Posted June 20, 2008 Posted June 20, 2008 I use _ScreenCapture_CaptureWnd to screen capture a window every 5minutes. Is their anyway to compare the 2 images and see if they are the same? I have searched the forums and looked for functions but I haven't found anything on this topic.
zorphnog Posted June 20, 2008 Posted June 20, 2008 You could just do a simple file compare: If _CompareFiles(@MyDocumentsDir & "\GDIPlus_Image(1).jpg", @MyDocumentsDir & "\GDIPlus_Image(2).jpg") = 1 Then ConsoleWrite("+> Files match" & @CRLF) Else ConsoleWrite("-> Files do not match" & @CRLF) EndIf Func _CompareFiles ($sFile1, $sFile2) Local $hFile1, $hFile2, $bFile1, $bFile2 $hFile1 = FileOpen($sFile1, 16) $hFile2 = FileOpen($sFile2, 16) If $hFile1 = -1 Then ConsoleWrite('!> Error: Could not open "' & $sFile1 & '"' & @CRLF) Exit EndIf If $hFile2 = -1 Then ConsoleWrite('!> Error: Could not open "' & $sFile2 & '"' & @CRLF) Exit EndIf $bFile1 = FileRead($hFile1) $bFile2 = FileRead($hFile2) If $bFile1 = $bFile2 Then Return 1 Return 0 EndFunc
Kip Posted June 20, 2008 Posted June 20, 2008 every file is different, because every file contains a different creation date. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
Spacetech Posted June 21, 2008 Author Posted June 21, 2008 every file is different, because every file contains a different creation date.So a FileRead wouldn't work?
zorphnog Posted June 23, 2008 Posted June 23, 2008 every file is different, because every file contains a different creation date.Thats why I compared the data in the file, not the file header info. Maybe you should try executing code before you comment.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now