Jump to content

screencapture error using Variables


Recommended Posts

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

 

SS_2232.jpg

Link to comment
Share on other sites

#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()

:P 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • Moderators

marko001,

Your variable "bottom" value is less than your "top" value: 467 < 579.

When you use numbers you have 579 and 667

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

@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 by marko001
Link to comment
Share on other sites

  • Moderators

marko001,

It works fine for me once I correct the value.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...