If more than one monitor is available, Sikuli is able to manage regions and click Note: You should check the result, since the user may cancel the capturing. Region the same way as using the selection tool in the IDE. The interactive capture mode is entered and allows the user to select a If text is omitted, the default “Select a region on the screen” is Text is displayed for about 2 seconds in the middle of the screen. Text – Text to display in the middle of the screen.Ī new Region object or None, if the user cancels the capturing process. Select a region on the screen interactively Parameters: It can be used directly in cases, where a parameter PS isĪllowed (e.g. The file name is returned and can be used later in the script as a reference Taken, the content of the selected rectangle is saved in a temporary file. If any arguments other than text are specified, capture() automaticallyĬaptures the given rectangle of the screen. If no text is given, the default “Select a region on the screen” Interactive Mode: The script enters the screen-capture mode like whenĬlicking the button in the IDE, enabling the user to capture a rectangle on Interactive mode, the user may cancel the capturing, in which case The path to the file, where the captured image was saved. y – y position of the rectangle to capture.x – x position of the rectangle to capture.text – text to display in the middle of the screen in the interactive.rectangle – an existing rectangle object (e.g., as a return value of.class Screen capture ( ) ¶ capture ( x, y, w, h ) Parameters: Second one lectRegion() just returns the position and dimension ofīoth features are available in the IDE via the buttons in the toolbar. There are two different versions: the first one Screen.capture() saves theĬontent of the selected rectangle in a file and returns its file name, whereas the At each time, a capturing is initiated, a new screenshot is taken. This will speed up processing, if the region is significantly smaller than the wholeĬapturing is the feature, that allows to grab a rectangle from a screenshot, to save Search for all following find operations to a smaller region than the whole screen. Another possibility is to say setROI() to restrict the So to speed up processing, saying region.find() will restrict the search On the other hand this may slow down processing speed, because of time consuming So its a convenience feature, that can be seen as an implicit use of the python In Multi Monitor Environments this is the primary monitor (use theĬonstant reference SCREEN, to access it all the time), that normally is Screen(0),īut might be another Screen() object depending on your platform. Screen being the implicit region in this case (mapped to the constant reference If written as find(PS) it acts on the default Normally all region methods are used as reg.find(PS), where reg is a region object They can not be modified using Sikuli script. The width and height of the rectangle denote the dimensions of the monitor Get the dimensions of monitor represented by the screen object. Get the number of screens in a multi-monitor environment at the time the That is initiated when your script starts: SCREEN=Screen(0). Without creating a new screen object, use the constant reference SCREEN, Note: If you want to access the default/primary monitor ( Screen(0) ) So you may either use getNumberScreens() or exception Using numbers, that do not represent an existing monitor, will stop the Monitors that are available at the time, the script is running (read for Numbers 1 and higher represent additional It creates a new screen object, that represents the default/primary monitor Id – an integer number indicating which monitor in a multi-monitor Screen: Setting, Getting Attributes and Information ¶ class Screen Screen ( ) ¶
0 Comments
Leave a Reply. |