Graphics Context - Brush

The Brush

The brush is the graphics context object that controls how areas are filled. The brush always has type TBrush and the current brush can be accessed via the datum Brush.

A new brush can only be constructed based on an existing brush, using the structure modification operator. The current default brush is always constant.

The TBrush Type

The TBrush type is a system defined structure with the following fields :-

EBrushFill fill

This controls the type of filling to be done.

The options are :-

Colour - Fill the region with a single colour.

Image - Fill the region with the preset image.

EBrushAlign align

This controls the alignment of the image ( when fill -> Image ).

The options are :-

Local - The image is aligned to the local origin of the shape being displayed.

Absolute - The image is aligned to the top left of the display.

Pinned - The image is aligned to a preset 'pin' location ( see below ).

Colour colour

This specifies the fill colour to use ( when fill -> Colour ). It will also be used for pen when the brush image is a 'pattern'.

Colour bgcolour

This only used when filling with a GraRLS pattern image and the pattern uses the fill value ( i.e. when the EFillMode 'Filled' is used in a Shape call when generating the original pattern ); the fill pixels use this colour.

EOverwrite overwrite

This is the same overwrite option as for pens, it applies to both the Colour mode and the Image mode.

TImage image

This is the image to use when the brush uses Image mode. The image may be a colour picture or a GraRLS pattern.

Point pin

This the location to used as the reference point when the alignment mode is Pinned.