Name
addArc( ) — add an arc to the object
Synopsis
$e->addArc( points =>[ $x, $y, $r, $startangle, $endangle],
linewidth =>$linewidth,
linetint =>$linetint,
filltint =>$filltint
)
The addArc( ) method will add an arc segment to the Elements
object. It takes up to four parameters, of which only the
points
parameter is required:
-
points
A
points
parameter is required, consisting of a reference to a list specifying the center coordinate, the radius of the arc, and two numbers specifying the starting angle and the ending angle describing the sweep of the arc. For example:addArc(points=>[50,50,25,0,360])
would add a complete circle centered at 50, 50 with a radius of 25. Note that the list of points is in the same form as the PostScript
arc
function.-
linewidth
The
linewidth
attribute can be used to specify the point size of the line with which the arc is to be stroked. If no value is given, the default line width is 1 point.-
linetint
The
linetint
attribute should be a number between and 1 representing a percentage of gray, with 1 as black and as white. Therefore, .8 would be the equivalent of a 20% gray screen. If no value is given, the line will be stroked in black (linetint=1
).-
filltint
The
filltint
attribute should be either -1 or a number between and 1 representing a percentage of gray, with 1 as black and as white. If the value is -1, the shape will not be filled in; it will be transparent. Otherwise, the shape will be opaque. The default value is -1.
Get Programming Web Graphics with Perl and GNU Softwar now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.