Subsections
- void ts_getpixel (int x, int y)
- void ts_putpixel (int x, int y)
- void ts_circle (int x, int y, int radius)
- void ts_line (int x1, int y1, int x2, int y2)
- void ts_hline (int x1, int x2, int y)
- void ts_vline (int x, int y1, int y2)
- void ts_rect (int x1, int y1, int x2, int y2)
- void ts_triangle (int x1, int y1, int x2, int y2, int x3, int y3)
- void ts_polygon (int points, int *xy)
- void ts_arc (int x, int y, int ang1, int ang2, int r);
- void ts_ellipse (int x, int y, int rx, int ry);
- void ts_floodfill (int x, int y);
Defined in draw.h
and draw.c
Like the text input-output functions, the drawing functions all take the smallest possible
number of parameters to put something on the screen: some coordinates.
Drawing parameters are set with the graphics parameter functions.
Reads the color of the pixel at position (x,y). The source bitmap is set
using ts_tobuff, ts_toscr or ts_tobmp.
Writes a pixel to the specified position in the bitmap. Color set with
ts_fgcolor and the destination bitmap is set using ts_tobuff, ts_toscr or ts_tobmp.
Draws a circle around point (x,y) using radius as radius. Use
ts_fill for switching fill mode.
Draws a line between (x1,y1) and (x2,y2).
Draws a horizontal line between x1 and x2 at vertical position y.
Draws a vertical line between y1 and y2 at horizontal position x.
Draws an outline rectangle with the two points as its
opposite corners. Use ts_fill for switching fill mode.
Draws an outline triangle with points
(x1,y1), (x2,y2) and (x3,y2) as vertexes. Use ts_fill for switching fill mode.
Draws a polygon with an arbitrary number of vertexes. Pass the number
of vertexes and an array containing a series of x, y points (should be an array with a total of
vertexes*2 values). Polygons are never filled. Only the contours are drawn.
Draws an arc with center (x,y) and radius r
starting at angle ang1 until it reaches angle ang1. Angles are in degrees counter-clockwise
(0-360): zero is to the right of the center point, larger values rotate anticlockwise from
there.
Draws an ellipse with center (x,y) and x-radius rx and
y-radius ry. This function is only suitable for horizontally or vertically oriented ellipses.
No other rotations are supported. Use ts_fill for switching fill mode.
Floodfills an enclosed area with the current drawing color starting at
point (x,y).