InterViews Reference Manual -- Brush

NAME
Brush - line style and width for a painter
SYNOPSIS
#include <InterViews/brush.h>
DESCRIPTION
A Brush defines the line thickness and line style for Painter operations that draw lines, curves, and unfilled shapes. The effect of these operations is as if a line-segment equal in length to the brush's width were dragged along an infinitely thin path between the specified coordinates. At each point along the path the brush is angled perpendicular to the path. As a special case, a brush width of zero specifies a minimal-width line. Many devices can render minimal-width lines more quickly than wide lines, but the resultant display may be device-dependent.

The effect of the operations is further influenced by the brush style.  A solid
brush paints all pixels along the path with foreground color.  A  dashed  brush
defines  alternating  foreground  and  background  segments, measured along the
length of the path.  Foreground segments are  painted  with  foreground  color.
The  filling of background segments is affected by the setting of the painter's
FillBg flag: if FillBg is true, background segments are painted with background
color; if the flag is false, background segments are left unpainted.

The  global  variable  ``single''  points  to a Brush for drawing minimal-width
solid lines.
PUBLIC OPERATIONS
Brush(int pattern[], int count, int width = 1)
Construct a brush with the specified width and line style. Pattern contains an array of integers that specifies the length of successive foreground and background segments. Even-numbered array indices (starting from 0) specify the length of foreground segments; odd-numbered indices specify background segments. Count contains the number of entries in the array. A count of zero specifies a solid brush.
Brush(int pattern, int width = 1)
Define a brush with a given width and a style specified by a bit vector. The least significant 16 bits of pattern are interpreted as a bit pattern; one bits specify foreground segments and zero bits specify background segments. A pattern of 0xffff specifies a solid brush.
int Width()
Return the brush's width in pixels.
SEE ALSO
Painter

Next: Button | Prev: Box | Up: index | Top: index