Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


How to draw points

This example code demonstrates how to:

[Top]


Drawing a single pixel

Use Plot() to draw a single point in the centre of the screen.

...
TPoint screenCenterPoint=rect.Center(); // the center of the screen
...
// draw a single pixel point in the center of the screen
gc.Plot(screenCenterPoint);
...

[Top]


Drawing a point three pixels wide

  1. Define a size for the pen tip as a TSize.

  2. Use SetPenSize() to increase the pen width from the default (single pixel). This shows how a plotted point three pixels wide is much easier to see than a single pixel. It is in fact drawn as a "+" shape.

  3. Use Plot() to draw a point in the centre of the screen.

...
TPoint screenCenterPoint=rect.Center(); // the center of the screen
...
// Set up a "bold" size for the pen tip to (default is 1,1)
TSize penSizeBold(3,3);
...
// draw a "bold" point 3 pixels across
gc.SetPenSize(penSizeBold);
gc.Plot(screenCenterPoint);
...