Drawing Graphics: 3.5 Shape Attributes: Line-Specific Attributes

Up: GEOS SDK TechDocs| Up | Prev: 3.4 Masks
GrGetLineWidth(), GrSetLineWidth(), GrGetLineJoin(), GrSetLineJoin(), GrGetLineEnd(), GrSetLineEnd(), GrSetMiterLimit(), GrGetLineStyle(), GrSetLineStyle(), GrSetLineAttr()

Line attributes determine characteristics of lines drawn with the GrDraw...() routines. They do not affect anything drawn with the GrFill...() routines.

You may work with the width used when drawing lines by means of the GrGetLineWidth() and GrSetLineWidth() routines.

The graphics system makes it easy to draw dotted lines. The line style attribute controls the "dottedness" with which lines should be drawn; it may be changed or retrieved with the GrSetLineStyle() and GrGetLineStyle() routines. Lines can be drawn using any of a number of standard system LineStyle s or by defining a custom dot pattern.

Custom dot patterns are defined in terms of arrays of pairs of bytes. The first byte of each pair gives the distance that the line should be drawn with the pen down, the second number the distance with the pen up. The array as a whole is stored in a DashPairArray . Dash lengths will scale with the line width.

Line joins govern the behavior of angles and corners. Using the appropriate line join style, a geode can specify that angles should be blunt, pointed, or rounded. GrGetLineJoin() returns the current line join drawing technique, while GrSetLineJoin() sets a new line join to use. The join is specified by a member of the LineJoin enumerated type. The miter limit governs the maximum length of mitererd joins; use GrSetMiterLimit() and GrGetMiterLimit() to work with this value.

The GrSetLineEnd() and GrGetLineEnd() routines set and retrieve the style with which the graphics system will draw the ends of line segments. The ending style is one of the LineEnd values. It may be round, square and even with the end of the line, or square and extending past the mathematical end of the line.

To set all of the line-drawing attributes at once, call GrSetLineAttr() .


Up: GEOS SDK TechDocs| Up | Prev: 3.4 Masks