diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-B32ED85A-913E-5C06-AEEB-1E2D6EF4CECF.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-B32ED85A-913E-5C06-AEEB-1E2D6EF4CECF.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,30 @@ + + + + + +Drawing a Rounded Rectangle

This topic provides an example that demonstrates how to draw a rounded rectangle using DrawRoundRect(). The dimensions of each corner (corner size and corner height) are given by a TSize argument.

+ Rounded rectangle construction + ... +// draw a rectangle with rounded corners, centered in the rectangle +TSize cornerSize(20,20); // set up the size of a rounded cornerSize +gc.DrawRoundRect(box,cornerSize); +...

In the following example code, one of the ellipses specified by the corner argument is shown, to illustrate how the rounded rectangle is constructed:

... +// draw a rectangle with rounded corners, +//centered in the rectangle, showing a corner ellipse +TSize cornerSize(20,20); // size of a rounded corner + +// rect for corner ellipse is twice the corner size +TSize cornerEllipseSize(cornerSize.iHeight*2,cornerSize.iWidth*2); +TRect cornerRectTl(box.iTl,cornerEllipseSize); +gc.DrawRoundRect(box,cornerSize); +gc.SetPenStyle(CGraphicsContext::EDottedPen); +gc.DrawEllipse(cornerRectTl); // corner construction ellipse +...
Drawing + to a Graphics Context Tutorials Drawing and Graphics Contexts
\ No newline at end of file