Jex Posted November 6, 2007 Posted November 6, 2007 (edited) That function useable for create screenshot capture scripts or like that things.expandcollapse popup#include <GUIConstants.au3> #include <Misc.au3> #include <ScreenCapture.au3> $Region = Region(1) Example3() Func Example1() MsgBox("", "", "X (Left) : " & $Region[0] & " | Y (Up) : " & $Region[1] & @CRLF & "X (Right) : " & $Region[2] & " | Y (Down) : " & $Region[3] & @CRLF & "Region size : " & $Region[4] & " x " & $Region[5]) EndFunc ;==>Example1 Func Example2() $Pixel = PixelSearch($Region[0], $Region[1], $Region[2], $Region[3], 0x84A35B) If Not @error Then MouseMove($Pixel[0], $Pixel[1], 0) EndFunc ;==>Example2 Func Example3() _ScreenCapture_Capture (@MyDocumentsDir & "\Test.jpg", $Region[0], $Region[1], $Region[2], $Region[3]) ShellExecute(@MyDocumentsDir & "\Test.jpg") EndFunc ;==>Example3 Func Region($Tray = 0) $Invisible = GUICreate("", 100, 100, -1, -1, $WS_POPUP, $WS_EX_TOPMOST) WinSetTrans($Invisible, "", 1) GUISetState(@SW_SHOW, $Invisible) While 1 Local $Pos1 = MouseGetPos() WinMove($Invisible, "", $Pos1[0] - 50, $Pos1[1] - 50) If $Tray = 1 Then TrayTip("", "X (Left) : " & $Pos1[0] & " | Y (Up) : " & $Pos1[1], 1, 16) If _IsPressed("01") Then GUIDelete($Invisible) Local $Pos1 = MouseGetPos(), $x1, $x2, $y1, $y2 $RegionGUI = GUICreate("", 1, 1, $Pos1[0], $Pos1[1], BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOPMOST) WinSetTrans($RegionGUI, "", 50) GUISetState(@SW_SHOW, $RegionGUI) Do Local $Pos2 = MouseGetPos() If $Pos2[0] < $Pos1[0] And $Pos2[1] < $Pos1[1] Then $x2 = $Pos1[0] $y2 = $Pos1[1] $x1 = $Pos2[0] $y1 = $Pos2[1] ElseIf $Pos2[0] > $Pos1[0] And $Pos2[1] < $Pos1[1] Then $x1 = $Pos1[0] $y2 = $Pos1[1] $x2 = $Pos2[0] $y1 = $Pos2[1] ElseIf $Pos2[0] > $Pos1[0] And $Pos2[1] > $Pos1[1] Then $x1 = $Pos1[0] $y1 = $Pos1[1] $x2 = $Pos2[0] $y2 = $Pos2[1] ElseIf $Pos2[0] < $Pos1[0] And $Pos2[1] > $Pos1[1] Then $x2 = $Pos1[0] $y1 = $Pos1[1] $x1 = $Pos2[0] $y2 = $Pos2[1] EndIf WinMove($RegionGUI, "", $x1, $y1, $x2 - $x1, $y2 - $y1) If $Tray = 1 Then TrayTip("", "X (Left) : " & $x1 & " | Y (Up) : " & $y1 & @CRLF & "X (Right) : " & $x2 & " | Y (Down) : " & $y2 & @CRLF & "Region size : " & $x2 - $x1 & " x " & $y2 - $y1, 1, 16) Until Not _IsPressed("01") TrayTip("", "", 0) GUIDelete($RegionGUI) ExitLoop EndIf WEnd Local $Pos3[6] = [$x1, $y1, $x2, $y2, $x2 - $x1, $y2 - $y1] Return $Pos3 EndFunc ;==>Region Edited November 7, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer
James Posted November 6, 2007 Posted November 6, 2007 That looks really cool Jex. Nice script! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Jex Posted November 7, 2007 Author Posted November 7, 2007 Thanks for your comment. I'm added one more example and changed little region function. My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer
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