Round rectangle example

You can create a round rectangle like the one in Figure 48 by passing a rectangle to a loop or curve geometry. This example uses TGLoop to make the rectangle.


The following code creates a round rectangle. The TGRect defines the dimensions of the rectangle, The TGPoint is an aspect parameter that specifies the height (TGPoint::fX) and width (TGPoint::fY) of the corner arcs. The round rectangle draws from the bottom of the top-left corner arc in a counterclockwise direction.

      TFillAndFrameBundle aBundle( TRGBColor( .75, .5, .5), TRGBColor( 0, 0, 0 ), 5.0 );
      TGLoop aRoundRectangle( TGRect( 10, 10, 125, 40 ), TGPoint( 10, 10 ) );
      thePort.Draw( aRoundRectangle, aBundle );

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker