<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > Load/Save-Import/Export IR's > Image/Pixel-Color Operations |
MiniRobotLanguage (MRL)
ANA.Snap
Capture Screenshot from localized WIndow and place it in an Image-Register (IR)
Intention
This command will capture a Screenshot from a specified window for further processing.
1. Capture Screenshot of complete Desktop and use it for Pattern-Search
This will include all Screens on a Dual-Screen System. Here we search a Pattern on the complete Desktop.
STW.ct|Progman|Program Manager
' We Snapshot the Desktop into IR 0
ANA.Snap|0
' This is the Pattern we search for
$$PAA=?path\Help16.bmp
' We load the Pattern into IR 1
ANA.Load|1|$$PAA
' This is the Pattern Searching Command,
' Due to the value "1" as last Parameter, we will get a Debugprint
' of all found Hits. The displayed Point is in the Center of the Pattern.
ANA.fpa|0|1|0|125|1
' This command will put the results of the search on to the Stack.
ANA.gres
' Number of found Patterns is on TOS
POP.$$POA
MBX. We got $$POA Results
' We do not need first 3 Found Pattern so we remove them from Stack
STJ.Remo|0,1,2
' This is the Pattern we drive to
POP.$$POA
MMV.t|$$POA
MBX.!
ENR.
2. Capture Screenshot of complete Desktop and save into a file
This will include all Screens on a Dual-Screen System. They will be saved as a single ".bmp" (BItmap-) File. You can choose any widely used picture format, for example ".png" or "Jpg".
STW.ct|Progman|Program Manager
ANA.Snap|0
$$FIL=?path\Desktop.png
ANA.Save|0|$$FIL
ENR.
3. Capture Screenshot of complete Desktop into a variable
This will include all Screens on a Dual-Screen System. They will be saved as a single Screenshot into the given Variable.
STW.ct|Progman|Program Manager
ANA.Snap|0
ANA.ToVar|0|$$FIL
LEN.$$FIL|$$RES
MBX.$$RES
ENR.
4. Capture Screenshot of actual window into image register
If you just locate any window, or child window, you can take a screenshot of these windows.
STW.ct|#32770|Basic-NAV Matrix 02
' We snap into the IR 2 here
ANA.Snap|2
ENR.
Syntax
ANA.Snap[|P1][|P2]
Parameter Explanation
P1 - opt. Image-Register number, if omitted, IR 0 will be used.
P2 - opt. In case there are Problems that the Mouse moves to much up or down by the height of the Titlebar, you can choose here another value.
0 - Snap only Client-Area from Window (default)
1 - Snap whole Window, remove Borders
2 - Snap whole Window incl. Borders
4 - Use internal default value that can be changed with the ANA.SetData - Command
The Command will leave a 0/1 on the TOS. As always, a 0 means Error, while a 1 means "all fine".
Example
'***********************************
' ANA.Snap-Sample
'***********************************
STW.ct|Progman|Program Manager
ANA.snap|0
ANA.Copy|0|1
ANA.BlockTo|0|0|2
ANA.rct|0|&H0|260|&H0
ANA.rct|0|&HFFFFFF|200|&HFFFFFF
ANA.logic|0|1|0|A XOR B NOT T|RGB
ANA.rct|0|&H0|260|&H0
ANA.rct|0|&HFFFFFF|200|&HFFFFFF
ANA.show|0!
ENR.
' Here you can see a part of the result of the Operation.
Remarks
-
Limitations:
-
See also:
• Inline-Data and Inline-Pictures