JScript DrawTool

DrawTool is a global object accessible in the JScript document operation and enables usage of drawing tools from scripts.

Methods and properties

Modes

BMDrawOver - paint over the background (the common blending mode).
BMReplace - replace pixels. This mode differs from the previous
            in cases where the color is semitransparent.
BMDrawUnder - the result will be visible only if the background is semitransparent.
RMBinary - jagged edges.
RMSmooth - with antialiasing.
SFMOutline - draw outlines of shapes.
SFMFilled - draw shapes using active fill-style.
SFMCombined - draw outlines and fill interior using active fill-style.
CMArbitrary - use arbitrary (non-integral) coordinates.
CMIntegral - integral coordinates.

Example

// set color to green and fill shapes with that color
DrawTool.SetColor1(0, 1, 0, 1);
DrawTool.ShapeFillMode = DrawTool.SFMFilled;
// use the simplified method to draw a circle with center at [30, 40]
// and diameter of 20 pixels:
DrawTool.ELLIPSE(Document, 30, 40, 20);
// the previous command is internally translated to:
// DrawTool.Execute(Document, "ELLIPSE", "30,40,20");

speech bubble iconRecent comments

user iconAnonymous on April 1st 2013 0

If I want to use JScript DrawTool to create a custom tool, this tool can draw an arrow image.But I can not get the coordinates of the starting point and end point coordinates.I would like to ask how can I do? Thank you
😊

my Email is peng198849@126.com
contact me

user icon