The objects of canvas.T
class and its subclasses provides
several methods that can be invoked manually to draw variety of things
if you desire so. These methods take Postscript points
as the unit of X and Y
coordinates, as described in Section 4.
(These methods obey the scaling-factor specifications).
linestyle, x1, y1, x2, y2) |
# draw a line segment from (10,20) to (100, 200) can.line(line_style.blackdash1, 10, 20, 100, 200)
linestyle, fillstyle, [(x1,y1), ..., (xn, yn)], shadow = None) |
Draw a polygon points, with linestyle (see Section 14), and fill with fillstyle (see Section 16). Parameter points is a list of coordinates, e.g., ((10,10), (15,5), (20,8)). Value of linestyle can be None, in which case no line is drawn on the perimeter. Value of fillstyle can also be None, in which the internal of the polygon are left undrawn. Parameter shadow is either None or tuple (xdelta, ydelta, shadowstyle). If non-None, a shadow of shadowstyle (see Section 16) is drawn beneath the polygon at the offset (xdelta, ydelta).
can.polygon(line_style.default, fill_style.default, [(10, 20), (100, 200), (300,300)])
linestyle, fillstyle, x1, y1, x2, y2, shadow=None) |
Parameter shadow is either None or tuple (xdelta, ydelta, shadowstyle). If non-None, a shadow of shadowstyle (see Section 16) is drawn beneath the polygon at the offset (xdelta, ydelta).
can.rectangle(line_style.default, fill_style.default, 10, 20, 300, 300)
linestyle, fillstyle, x, y, radius, y_elongation=1, start=0, end=360, shadow=None) |
The start and end angles are specified in degrees; i.e., between 0 and 360. Parameter shadow is either None or tuple (xdelta, ydelta, shadowstyle). If non-None, a shadow of shadowstyle (see Section 16) is drawn beneath the polygon at the offset (xdelta, ydelta).
linestyle, fillstyle, x1, y2, x2, y2, radius, shadow=None) |
Parameter shadow is either None or tuple (xdelta, ydelta, shadowstyle). If non-None, a shadow of shadowstyle (see Section 16) is drawn beneath the polygon at the offset (xdelta, ydelta).
linestyle, [(x1,y2), ..., (xn, yn)]) |
x, y, text) |
string) |