
Next: Clear Operations
Up: Basic Commands
Previous: Color Operations
These are the basic graphics operations for drawing to a viewport.
Each function takes a viewport as its argument and returns a function
operating within that viewport.
Further arguments, if any, are curried.
For example, (draw-line viewport) returns a
function, that can then be applied to the proper arguments to draw a
line in the viewport corresponding to viewport descriptor viewport.
An example follows.
-
((draw-viewport viewport) color)
draw-viewport takes a viewport descriptor. It returns a
function that colors the entire contents of viewport.
The optional color argument defaults to black. -
((draw-pixel viewport) p color)
draw-pixel takes a viewport descriptor. It returns a function that
draws a pixel in viewport at the specified position.
The optional color argument defaults to black. -
((draw-line viewport) p1 p2 color)
draw-line takes a viewport descriptor. It returns a function that
draws a line in the viewport connecting positions p1 and p2.
The optional color argument defaults to black. -
((draw-rectangle viewport) pos width height color)
draw-rectangle takes a viewport descriptor. It returns a function that
draws a rectangle border in the viewport with the top-left of the rectangle
at the position pos and with sides width across and height tall.
The optional color argument defaults to black. -
((draw-solid-rectangle viewport) pos width height
color)
draw-solid-rectangle takes a viewport descriptor. It returns a function that
paints a solid rectangle in the viewport with the top-left of the rectangle
at the position pos and with sides width across and height tall.
The optional color argument defaults to black. -
((draw-ellipse viewport) pos width height
color)
draw-ellipse takes a viewport descriptor. It returns a function that
draws an ellipse border in the viewport. The pos, width,
and height arguments are as in draw-rectangle; the ellispse
is inscribed within the specified rectangle.
The optional color argument defaults to black. -
((draw-solid-ellipse viewport) pos width height
color)
draw-solid-ellipse takes a viewport descriptor. It returns a function that
paints a solid ellipse in the viewport. The pos, width,
and height arguments are as in draw-rectangle; the ellispse
is inscribed within the specified rectangle.
The optional color argument defaults to black. -
((draw-string viewport) p string color)
draw-string takes a viewport descriptor. It returns a function that
draws a string at a specified location in the viewport. The lower
left of the string begins at p.
The optional color argument defaults to black. -
((draw-pixmap viewport) filename p)
draw-pixmap draws an X bitmap into viewport w with its
upper left corner at position p.

Next: Clear Operations
Up: Basic Commands
Previous: Color Operations
PLT