<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > Undercover and Graphics > Undercover Operations |
MiniRobotLanguage (MRL)
UCV.ellipse
UCV.eli
Draw a box onto the cover
Intention
This command will draw a elliptical, colored, filled shape, between two diagonal pixel-coordinates onto the cover. The shape-outline is been drawn in the foreground color. The "UCV.fillstyle" command defines the fill-style inside the shape. As this is a very general graphics command, it will enable you to draw all sorts of shapes that are circular or elliptical. If you want to end up with a perfect circle, prefer the "UCV.box" command and make the corners 100% round for this.
General usage is simple:
' Set foreground color
UCV.fgr|&HFF00FF
' Draw a black filled ellisoid
UCV.ellipse|600,1|200,100
Points that have been defined 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 ellipse.
UCV.nbi
UCV.dbw
UCV.fgr|&HFF00FF
UCV.set pixel|100,100
UCV.ellipse||200,100
PAU.5
Here is a more complex demo program:
$$XMA=800
$$STP=15
UCV.nbi
UCV.dbw
FOR.$$XCO|1|($$XMA+$$STP)|$$STP
UCV.fgr|&HFF00FF
UCV.fillstyle|4|-2
UCV.eli|0,$$XCO|$$XCO,$$XMA|40
UCV.fgr|&HFF0000
UCV.fillstyle|5|-3
UCV.eli|$$XCO,0|$$XMA,$$XCO|70
NEX.
PAU.5
ENR.
Below you see the output graphics. Note the effects of the
' Draw transparent shapes
UCV.fillstyle|4|-2
' Here is an example that will draw circular shapes
'
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.eli|10,10|500,500
PAU.0.1
NEX.
PAU.1
UCV.
ENR.
' This line will remove the cover
UCV.
Syntax
UCV.ellipse|P1,P2[|P3,P4]
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