marko001 Posted July 9, 2020 Share Posted July 9, 2020 Where am I wrong? #include <ScreenCapture.au3> Func _testscreencapture() Local $a=83 Local $b=579 Local $c=422 Local $d=467 _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image76.jpg",83, 579, 422, 667) if @error Then ConsoleWrite(@error & @CRLF) ShellExecute(@MyDocumentsDir & "\GDIPlus_Image76.jpg") Sleep(2000) _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image77.jpg",$a, $b, $c, $d) ShellExecute(@MyDocumentsDir & "\GDIPlus_Image77.jpg") if @error Then ConsoleWrite(@error & @CRLF) EndFunc _testscreencapture() If use vars instead of "numbers" _screencapture doesn't take the screenshot: in attach you can see the error. It happens both with SciTE 3.6.6 and 4.2.0 Thanks a lot, Marco Link to comment Share on other sites More sharing options...
Danp2 Posted July 9, 2020 Share Posted July 9, 2020 Have you checked the value of @error immediately after the call to _ScreenCapture_Capture? P.S. What version of Autoit? If you are running an older version, then that may explain the issue. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
argumentum Posted July 9, 2020 Share Posted July 9, 2020 #include <ScreenCapture.au3> Func _testscreencapture() Local $a=83 Local $b=579 Local $c=422 Local $d=667 ; 467 <<<<<<<<<<<< _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image76.jpg",83, 579, 422, 667) if @error Then ConsoleWrite(@error & @CRLF) ShellExecute(@MyDocumentsDir & "\GDIPlus_Image76.jpg") Sleep(2000) _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image77.jpg",$a, $b, $c, $d) ShellExecute(@MyDocumentsDir & "\GDIPlus_Image77.jpg") if @error Then ConsoleWrite(@error & @CRLF) EndFunc _testscreencapture() Danp2 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 9, 2020 Moderators Share Posted July 9, 2020 marko001, Your variable "bottom" value is less than your "top" value: 467 < 579. When you use numbers you have 579 and 667 M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
marko001 Posted July 9, 2020 Author Share Posted July 9, 2020 On 2/22/2020 at 5:14 PM, Comatose said: @Melba23 yes I saw but also changing this error remains (error 1) Link to comment Share on other sites More sharing options...
marko001 Posted July 9, 2020 Author Share Posted July 9, 2020 (edited) @Danp2 Autoit Version should be (read from Help) 3.3.14.2 and both SciTe @argumentum I realized the error but it was just a missprint, I corrected as I told to @Melba23 but error still remains [EDIT]: ALL OK, in the meanwhile I was using a modified ScreenCapture(v2). Now it seems to work fine Edited July 9, 2020 by marko001 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 9, 2020 Moderators Share Posted July 9, 2020 marko001, It works fine for me once I correct the value. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
argumentum Posted July 9, 2020 Share Posted July 9, 2020 the code I posted runs fine on my PC. I have no idea what may be happening on your side to not work. #include <ScreenCapture.au3> Func _testscreencapture() Local $ver = @SEC & @MSEC Local $a=83 Local $b=579 Local $c=422 Local $d=667 ; 467 <<<<<<<<<<<< _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image" & $ver & "A.jpg",83, 579, 422, 667) if @error Then ConsoleWrite(@error & @CRLF) ShellExecute(@MyDocumentsDir & "\GDIPlus_Image" & $ver & "A.jpg") Sleep(2000) _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image" & $ver & "B.jpg",$a, $b, $c, $d) ShellExecute(@MyDocumentsDir & "\GDIPlus_Image" & $ver & "B.jpg") if @error Then ConsoleWrite(@error & @CRLF) Sleep(1000) FileDelete(@MyDocumentsDir & "\GDIPlus_Image" & $ver & "*.jpg") EndFunc _testscreencapture() Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
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