<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > Undercover and Graphics > Undercover Operations |
MiniRobotLanguage (MRL)
UCV.box
Draw a box onto the cover
Intention
This command will draw a box, colored and using a custom fillstyle, with optional round corners between two diagonal pixel-coordinates onto the cover. The box-outline is been drawn in the foreground color. The "UCV.fillstyle" command defines the fill-style inside the box. As this is a very general graphics command, it will enable you to draw all sorts of shapes that are rectangular or even a circle (make corners 100% round for this).
General usage is simple:
' Set foreground color
UCV.fgr|&HFF00FF
' Draw thwe line from 600,1 to 200,100
UCV.line|600,1|200,100
Points that have been set using the "set point" command can be used as starting points for the "Line" command. In that case you can omit the second coordinate pair.
' We set a single Pixel at 1,1 which will then
' be the starting point for the line.
UCV.set pixel|1,1
' you can use mathematical inline calculations
' for all coordinates
UCV.line|($$XCO*2.5),600
' Here is a complete example
'
UCV.nbi
UCV.dbw
FOR.$$COL|0|6
' Set foreground color
UCV.fgr|&HFF0000
' Set fillcolor and fillstyle
UCV.fls|$$COL|&H00FFFF
' Make it a circle (100% round corners)
UCV.box|10,10|500,500|100
PAU.0.1
NEX.
PAU.1
UCV.
ENR.
Here is another example:
$$XMA=800
$$STP=15
UCV.nbi
UCV.dbw
FOR.$$XCO|1|($$XMA+$$STP)|$$STP
UCV.fgr|&HFF00FF
UCV.fillstyle|4|-2
UCV.box|0,$$XCO|$$XCO,$$XMA|40
UCV.fgr|&HFF0000
UCV.fillstyle|5|-3
UCV.box|$$XCO,0|$$XMA,$$XCO|70
NEX.
PAU.5
ENR.
This is the output from the above Script:
' This line will remove the cover
UCV.
Syntax
UCV.box|P1,P2[|P3,P4][|P5]
Parameter Explanation
P1,P2 - Screen-Pixel-Coordinates for the starting Point of the line to be drawn.
P3,P4 - (optional) Screen-Pixel-Coordinates for the ending-Point of the line to be drawn.
If omitted, the last used Coordinates are used. This way you can easily draw a figure
of lines.
P5 - (optional) Roundness of corners in percent from 0 to 100%. If you choose 100%,
you may end up with a circle.
Example
'***********************************
' UCV.-Sample
'
'***********************************
$$XMA=800
$$STP=15
UCV.nbi
UCV.dbw
UCV.fgr|&HFF00FF
FOR.$$XCO|1|($$XMA+$$STP)|$$STP
UCV.fgr|&HFF00FF
UCV.fillstyle|4|-2
UCV.box|0,$$XCO|$$XCO,$$XMA|40
UCV.fgr|&HFF0000
UCV.fillstyle|5|-3
UCV.box|$$XCO,0|$$XMA,$$XCO|70
NEX.
PAU.5
ENR.
Remarks
-
Limitations:
PopUp-Menus and other TopMost Forms may be able to get temporarily in front of the Cover-form. This is due to windows-technical reasons and not a bug.
See also:
• ! Smart Package Robot 's Undercover Operations
• ! UCV. - Undercover Graphics