[C#] Example 1: Create RgbColor

The abstract PatternColor class represents colors, which are defined with the pattern color space. A pattern color paints with a pattern rather than a single color. PatternColor is inherited by the Gradient and TilingBase classes.

Figure 2: RadialGradient

A tiling pattern consists of a small graphical figure called a pattern cell. Painting with the pattern replicates the cell at fixed horizontal and vertical intervals to fill an area. The tiling pattern is represented by the TilingBase abstract class, which exposes the following properties:

AllowSmallDistortion: Pattern cells are spaces consistently. To achieve this, the pattern cell might be slightly distorted by making small adjustments to the HorizontalSpacing and VerticalSpacing.

NoDistortion: Pattern cells are not distorted, but the spacing between pattern cells may vary. This achieves the spacing requested by HorizontalSpacing and VerticalSpacing on average, but not necessarily for each individual pattern cell.

FastTiling: Pattern cells are spaced consistently as in AllowSmallDistortion type but with additional distortion permitted to enable a more efficient painting.

The TilingBase class is inherited from the following classes:

Tiling: Represents a tiling pattern.

UncoloredTiling: Represents an uncolored tiling pattern. This type of tiling patterns can be defined with some specific content, and then reused with a different color of their content. It exposes two additional properties - Tiling which represents the tiling to be used and Color representing the color of the content of the specified tiling.

Since the TilingBase class implements the IContentRootElement interface like RadFixedPage, the content of the tiling can be modified using the FixedContentEditor class. Example 4 shows how a tiling pattern can be created.