Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Graphics context settings

A graphics context includes the following settings:


Drawing mode

This is used to determine the logical operation used to put pen or brush colour onto the graphics device. The usual modes are: no effect; write colour; and exclusive or. Other possible logical combinations are supported.

[Top]


Pen colour, line size and style

The pen is used for free line and shape outline drawing and also for text. The line styles include solid and various dot and dash combinations. Lines may be drawn in various sizes.

[Top]


Brush colour, style and origin

The brush is used for filling areas drawn with the shape primitives, and also for text background fills. You can specify a colour, pattern and style. The brush also has an origin point for the pattern. The way the brush fills depends on the drawing mode. A bitmap pattern may be used and then discarded.

[Top]


Text font and a justification mode

Font specification allows for a variety of typefaces and styles for sizes (bold, underline, italic, etc.). Text colour (foreground) depends on the current pen colour and drawing mode. Text background fill depends on the current brush settings. Text justification may be set for word justification, or full WYSIWYG with character justification. A font may be used and then discarded.

[Top]


Co-ordinate origin

All GDI operations take place within a co-ordinate system. By default the pixel in the top left corner of the screen is the origin, and has co-ordinates (0,0). The co-ordinates of the pixel in the bottom right of the screen depend on the dimensions of the display in use.

There is, however, a function to set the position of the origin of a graphics context — CGraphicsContext::SetOrigin(). All subsequent drawing operations are then done relative to this new origin.

[Top]


Internal drawing position

A graphics context maintains an internal drawing position relative to its origin. This can be set, without drawing, by using:

The internal drawing position is also changed to the last point of the line(s) drawn by the operations:

The internal drawing position is used as the start point of the line drawn by: