rioujn Posted June 16, 2017 Posted June 16, 2017 Morning all, I run the following script in order to capture & save select areas of the screen via the command prompt i.e. via a series of command line inputs once the program is compiled as an executable. Include <ScreenCapture.au3> ;Local $dir =$CmdLine[6] Local $title = $CmdLine[1] Local $left = $CmdLine[2] Local $top = $CmdLine[3] Local $right = $CmdLine[4] Local $bottom = $CmdLine[5] _ScreenCapture_Capture(@ScriptDir & $title, $left, $top, $right, $bottom) If Not (@error == 0) Then ConsoleWrite("failed") Else ConsoleWrite("done") EndIf I am struggling to understand how the Screen_Capture function in AutoIt really works. For example, the function works very well when I return the following line into my command prompt: Quote \image1.png 0 0 1920 1039 > temp.txt However the function does not work for: Quote \image1.png 0 91 1920 1039 > temp.txt The application appears to work for a very select number of pixel combinations only. In short, I want to know why this is the case, am I missing something important? Moreover, is the Screen_Capture function set up such that it will capture the image in the format specified, or merely convert e.g. jpeg into the desired format as specified by .png or .bmp extension for example. What is the native file type of the function and if conversion does take place, what is the maximum resolution possible via this function? I want to use Screen_Capture as it allows for pixel selection, which will render my work more efficient, I do not want to revert to whole-screen capture solutions. Thanks in advance, Joseph
funkey Posted June 16, 2017 Posted June 16, 2017 Works fine for me with every size i tried. Don't know what the problem is. Try if it fails without console compilation #include <ScreenCapture.au3> Local $title = "Test.png" _ScreenCapture_Capture(@ScriptDir & "\" & $title, 0, 91, 1920, 1039) If @error <> 0 Then ConsoleWrite("failed" & @CRLF) Else ConsoleWrite("done" & @CRLF) EndIf If it fails, then copy function '_ScreenCapture_Capture' from includes to your script and test if 'WinAPI_BitBlt' fails (ConsoleWrite(_WinAPI_GetLastError())) or where the problem is. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
Moderators JLogan3o13 Posted June 16, 2017 Moderators Posted June 16, 2017 Moved to the correct forum "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
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