<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > Change Resolution > Image/Pixel-Color Operations |
MiniRobotLanguage (MRL)
ANA.Grab
Copy a smaller Portion from an IR starting at 0,0 to another IR removing empty Lines (empty -> just Background)
Intention
This command removes empty Lines at top and left side and cuts out a specified amount of Lines away from Right and Bottom sides of IR P1. The result will be moved to P2.
ANA.Grab will also automatically move theSource Rectangle up direction 0,0, and remove all empty lines.
Use ANA.Grab together with ANA.FromClipboard to store Clipboard-Content in IR 0 and display it
This will use IR 0 and also show the Contents.
$$PAF=?exeloc\Pics
$$FIL?$$PAF\P4.jpg
ANA.Load|0|$$FIL
' The Grab Command is optional, it can be used to "Cut the borders" of an IR before other usage
ANA.Grab|0|1|160|400|3
ANA.ToClipboard|1
' Picture is now in the Windows Clipboard
ENR.
Syntax
ANA.Grab[|P1][|P2|P3|P4|P5][|P6]
Parameter Explanation
P1 - Image-Register number for Source IR
P2 - Image-Register number for Target IR
P3 - Right-Border of Image to copy
P4 - Bottom-Border of Image to copy
P5 - Blit-Constant Parameter, if omitted Standard will be used. Details see Blit-Modes
The Command will leave a 0/1 on the TOS. As always, a 0 means Error, while a 1 means "all fine".
Example
'***********************************
' ANA.Grab-Sample
'***********************************
$$PAF=?exeloc\Pics
$$FIL?$$PAF\P4.jpg
ANA.Load|0|$$FIL
ANA.Grab|0|1|160|400|3
ANA.Show|1!
' Picture is now in the Windows Clipboard
ENR.
'***********************************
' ANA.ToClipboardRect-Sample
'***********************************
$$PAF=?exeloc\Pics
$$FIL=$$PAF\P4.jpg
ANA.Load|0|$$FIL
ANA.ToClipboardRect|0|150|88|290|189|2
ANA.FromClipboard|1
ANA.Show|1!
ENR.
'***********************************
' ANA.Grab-Sample, used for Text recognition
'***********************************
ANA.New|0|800|400
ANA.Fill|0|&Hffffff
' Backgroundcolor
$$LAA=-2
' Fontname
$$LAC=Arial
$$TXT=add
VAN.$$COL=0
LEN.$$TXT|$$LET
ANA.PrintAt|0|$$TXT|$$COL|$$LAA|$$XP1|$$YP1|9|$$LAC|1
ANA.Grab|0|1|(9+($$LET*8))|9
ANA.GetRes|1|$$XRE|$$YRE
DBP.Res.$$XRE,$$YRE
'VAR.$$PAT=?pattern\P1.bmp
'ANA.Load|1|$$PAT
'ANA.Show|1!
' Flag "A" can be set to 1,2 or 3
SFP.fa|1
SFP.Snap_Border|0
STW.ct|Chrome_WidgetWin| - Brave
SWP.0,0|1414,966|T
ANA.Snap|0
ANA.fpa|0|1|40|150|1
' This command will put the results of the search on to the Stack.
' Number of found Patterns is on TOS
POP.$$POA
DBP.We got $$POA Results
JIZ.$$POA|enx
FOR.$$LN1|1|$$POA
POP.$$POB
MMV.w|$$POB
PAU.4
NEX.
:enx
ENR.
Remarks
-
Limitations:
-
See also:
• CLP. - Clipboard - Operation