Important: The information in this document is obsolete and should not be used for new development.
Drawing Rectangles
A rectangle is defined by a data structure of typeRect
, in which you specify two points (for the upper-left and lower-right corners of the rectangle) or four boundary coordinates (one for each side of the rectangle). After defining a rectangle (such as by using theSetRect
procedure), you can use theFrameRect
procedure to outline it with the size, pattern, and pattern mode of the graphics pen.You can use the
PaintRect
procedure to draw a rectangle's interior with the pattern of the graphics pen, using the pattern mode of the graphics pen.Using the
FillRect
procedure, you can draw a rectangle's interior with any pattern you specify. The procedure transfers the pattern with thepatCopy
pattern mode, which directly copies your requested pattern into the shape.You can use the
EraseRect
procedure to erase a rectangle; this procedure fills the rectangle's interior with the background pattern for the current graphics port. Making the shape blend into the background pattern of the graphics port effectively erases the shape. For example, you can useEraseRect
to erase the port rectangle for a window before redrawing into the window.You can use the
InvertRect
procedure to invert a rectangle; this procedure reverses the colors of all pixels within the rectangle's boundary. On a black-and-white monitor, this changes all black pixels in the shape to white, and changes all white pixels to black. Although this procedure operates on color pixels in color graphics ports, the results are predictable only with direct pixels or 1-bit pixel maps.
Subtopics
- FrameRect
- PaintRect
- FillRect
- EraseRect
- InvertRect