Image/Pixel-Color Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > Change Resolution >

Image/Pixel-Color Operations

ANA.CutRect - Crop Borders from IR

Previous Top Next


MiniRobotLanguage (MRL)

 

ANA.CutRect

Crop Borders from IR

 

 

Intention

 

This command cut a specified amount of Lines away from all 4 sides of an IR. I can be used to cut the Borders.

 

Use ANA.CutRect 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 CutRect Command is optional, it can be used to "Cut the borders" of an IR before other usage

ANA.CutRect|0|150|160|400|200

ANA.ToClipboard|0

' Picture is now in the Windows Clipboard

ENR.

 

 

 

ANA.CutRect is a bit special. Assume you have a picture of 640x400 and you specify:

 

ANA.CurRect|0|50|50|640|400

 

Then you may get a black Border of size 50 on the right side. This is because the limitation is the original Picture-Size.

If you specify instead a Target-Rectangle-Size that is larger then the original size, you will get a perfect match without a black Border.

ANA.CutRect|0|50|50|6400|4000

 

Of course you can specify exactly what you want, in such case please note that the X- and Y-Size is reduced by the values of how much you cut out at the upper and left side.

So this line would also do it:

ANA.CutRect|0|50|50|590|350 

 

 

Syntax

 

ANA.CutRect[|P1][|P2|P3|P4|P5][|P6]

 

Parameter Explanation

 

P1 - opt. Image-Register number for Source and Target IR, if omitted, IR 0 will be used.

 

' If given, you must specify all 4 Rect-Parameters

P2 - Left-Border of Image to copy

P3 - Upper/Top-Border of Image to copy

P4 - Right-Border of Image to copy. If too large, will be replaced by Image maximum size.

 P5 - Bottom-Border of Image to copy. If too large, will be replaced by Image maximum size.

 

P6 - 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.ToClipboard-Sample

'***********************************

$$PAF=?exeloc\Pics

$$FIL=$$PAF\P4.jpg

ANA.Load|0|$$FIL

ANA.CutRect|0|150|160|4000|2000

ANA.ToClipboard|0

ANA.Show|0!

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.

 

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

See also:

 

    Blit-Modes

  ANA.FromClipboard

  CLP. - Clipboard - Operation