Drawing Points, Lines, and Shapes

The functions described below draw points, lines, and shapes. For a definition of bounding rectangle and pixel cursor, see “Bounding Rectagles” and “The Pixel Cursor”.

_arc

Draws an elliptical arc. Pass eight short integers: four pairs of x and y coordinates. The first two pairs are the corners of the bounding rectangle. The third and fourth are the starting and ending points of the arc. Returns 0 if unsuccessful.

_arc_wxy

Draws an arc within the window. Pass four wxycoord structures. The first two are the corners of the bounding rectangle. The third and fourth are the starting and ending points of the arc. Returns 0 if unsuccessful.

_ellipse

Draws an ellipse or a circle. Pass a short fill flag (_GBORDER or _GFILLINTERIOR) and four short integers representing the corners of the bounding rectangle. Returns 0 if unsuccessful.

_ellipse_w

Draws an ellipse or a circle within a window. Pass a short fill flag (_GBORDER or _GFILLINTERIOR) and four doubles representing the corners of the bounding rectangle. Returns 0 if unsuccessful.

_ellipse_wxy

Draws an ellipse or a circle. Pass a short fill flag (_GBORDER or _GFILLINTERIOR) and two _wxycoord structures representing the two corners of the bounding rectangle. Returns 0 if unsuccessful.

_getcurrentposition

Returns the current pixel cursor position in viewport coordinates as an _xycoord structure. The current position can be changed by _arc, _lineto, and _moveto. The default position is the center of the viewport.

_getcurrentposition_w

Returns the current position of the pixel cursor as a _wxycoord structure containing the x and y coordinates. Pass nothing.

_getpixel

Returns a pixel's color index. Pass a short x and y coordinate (in viewport coordinates). If the point is outside the clipping region, the function returns –1.

_getpixel_w

Returns a pixel's color index. Pass two doubles: an x and y coordinate.

_lineto

Draws a line from the current pixel cursor position to a specified point. Pass a short x and a short y position. Returns 0 if unsuccessful.

_lineto_w

Draws a line from the current pixel position to a specified window coordinate point. Pass a double x and y position. Returns 0 if unsuccessful.

_moveto

Moves the pixel cursor to a specified point (with no graphic output). Pass an x and y position. Returns the coordinates of the previous position in an _xycoord structure.

_moveto_w

Moves the pixel cursor to a specified point in a window. Pass two doubles: an x and a y coordinate. Returns the previous position as a _wxycoord structure.

_pie

Draws a figure shaped like a pie slice. Pass a short fill flag and eight short integers. The first four describe the bounding rectangle. The final four represent the starting vector and ending vector. Returns 0 if unsuccessful.

_pie_wxy

Draws a pie-slice figure within a window. Pass a short fill flag and four _wxycoord structures. The first two describe the bounding rectangle. The second two represent the starting vector and ending vector. Returns 0 if unsuccessful.

_rectangle

Draws a rectangle in the current line style. Pass a short fill flag (_GFILLINTERIOR or _GBORDER) and four short integers: the x and y coordinates of opposite corners. Returns 0 if unsuccessful.

_rectangle_w

Draws a rectangle in the current line style. Pass a short fill flag (_GFILLINTERIOR or _GBORDER) and four doubles: the x and y window coordinates of opposite corners. Returns 0 if unsuccessful.

_rectangle_wxy

Draws a rectangle in the current line style. Pass a short fill flag (_GFILLINTERIOR or _GBORDER) and two _wxycoord structures describing the x and y coordinates of opposite corners. Returns 0 if unsuccessful.

_setpixel

Sets a pixel to the current color (which is selected by _setcolor). Pass it integer x and y coordinates. Returns the previous value of the pixel or –1 if unsuccessful.

_setpixel_w

Sets a pixel to the current color (which is selected by _setcolor). Pass it double x and y coordinates describing a position within the window. Returns the previous value of the pixel or –1 if unsuccessful.