AutoHotkey Community

It is currently May 26th, 2012, 6:35 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: February 20th, 2008, 9:03 am 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
Here is a simple script that shows the differences in images.
Image
I selected a small section and moved it just a little bit in the image on the right. you can see where in the differences window.
Code:
FileSelectFile, File1, , , Select File 1
FileSelectFile, File2, , , Select File 2
WindowSize := (A_ScreenWidth / 3) - 20
Gui, 1:+AlwaysOnTop +ToolWindow +LastFound
Gui, 1: Add, Pic, x0 y0, %File1%
Gui, 1:Show,% "y0 h" . WindowSize . " w" . WindowSize, Differences
hGui1 := WinExist()
WinSet, Trans, 255

Gui, 2:+AlwaysOnTop +ToolWindow +LastFound
Gui, 2: Add, Pic, x0 y0, %File1%
Gui, 2:Show,% "y0 x0 h" . WindowSize . " w" . WindowSize, File 1
hGui2 := WinExist()
WinSet, Trans, 255

Gui, 3:+AlwaysOnTop +ToolWindow +LastFound
Gui, 3: Add, Pic, x0 y0, %File2%
Gui, 3:Show,% "y0 x" . A_ScreenWidth - WindowSize - 10. "h" . WindowSize . " w" . WindowSize, File 2
hGui3 := WinExist()
WinSet, Trans, 255

hDc1 := DllCall("GetDC", "uint", hGui1)
hDc2 := DllCall("GetDC", "uint", hGui3)
DllCall("gdi32.dll\BitBlt", UInt,hDC1, Int, 0, Int, 0, Int, WindowSize, Int, WindowSize, UInt,hDC2, Int, 0, Int, 0, UInt, SRCINVERT := 0x660046)
DllCall("gdi32.dll\ReleaseDC", UInt,hGui1,UInt,hDC1)
DllCall("gdi32.dll\ReleaseDC", UInt,hGui2,UInt,hDC2)
return

3GuiClose:
2GuiClose:
GuiClose:
ExitApp

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Shows 1st image
PostPosted: March 4th, 2008, 11:11 pm 
Offline

Joined: June 22nd, 2007, 4:42 am
Posts: 40
If they are identical, then it shows black which is correct

But when the images are different for some reason it always shows the 1st image in the differences.

_________________
Truth is truth, whether you believe it or not.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 7th, 2008, 12:30 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
It shows what is different in both images. Were that not the case, you would be able to read the text in the example above.

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, siterip, Stigg and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group