Drawing Attributes and Palettes

With Views you have at your disposal a large selection of fill and line patterns, gradients, colors, and font attributes to apply to graphic objects and text.

Because these resources are grouped in palettes and are shared among any number of objects, you can easily make global changes while minimizing memory consumption.

Color

In a simple drawing situation, such as the creation of a rectangle, the actual drawing is carried out with what is referred to as the foreground color, and the area “behind” the drawing is referred to as the background color.

  • Foreground Color  The foreground color is used for drawing dots, arcs, lines, polylines, and so on. It is also used to display character strings and to fill areas such as polygons and arcs.

  • Background Color  The background color is used as a second color when filling with patterns and drawing character strings.

Line Style and Width

Besides ordinary lines, referred to as “solid,” you can draw straight lines and curves composed of dots or dashes. This is the line style. Line width refers to the thickness of the lines in a drawing.

The line style and width define the exact visible aspect of all line drawings as well as line-type drawings including IlvPolyline and IlvSpline.

Patterns

A pattern refers to the design used to fill surfaces. In Views, there are three types of pattern.

Monochrome Pattern

The word “pattern” designates a monochrome (or two-color) design. Views offers sixteen ready-to-use patterns.

Here is an example of a pattern:

A Pattern

This particular pattern could be obtained by using a mask composed of a 16x16 array of bits, as you see here:

A Pattern Mask

Inside a pattern mask, we speak of the 1 bits as the foreground, and the 0 bits as the background. In other words, the pattern resource invokes the color resource.

Color Pattern

Whereas an ordinary pattern is two-dimensional, a color pattern incorporates a third dimension, depth, to deal with color.

Instead of having simply a 1 or a 0 at each location in the array, you insert a number that indicates the color to be used at that point in the color pattern. The default value for the color pattern is zero (0) indicating that no color pattern is to be used.

Gradient Pattern

A gradient pattern allows you to fill areas using linear and radial gradients. Views has a dedicated API which allows you to fine tune the rendering of your gradients. See section IlvGradientPattern: The Pattern Class Dedicated to Gradients for details.

Font

Fonts are used with character strings, that is, when drawing text.