1 TGRect aRectangle( 50, 50, 100, 80 ); 2 TGArea anArea( aRectangle ); 3 4 TGEllipse anEllipse( TGRect( 70, 70, 90, 90 ) ); 5 anArea += TGArea( anEllipse ); 6 7 TGPolygon aPolygonGeometry; 8 aPolygonGeometry.Append( TGPoint( 135, 105 ) ); 9 aPolygonGeometry.Append( TGPoint( 100, 75 ) ); 10 aPolygonGeometry.Append( TGPoint( 80, 75 ); 11 aPolygonGeometry.Append( TGPoint( 105, 105 ); 12 aPolygonGeometry.Append( TGPoint( 130, 55 ) ); 13 14 anArea -= ( aPolygon ); 15 16 TFillAndFrameBundle aBundle( TRGBColor( .75, .5, .5 ),TRGBColor( 0, 0, 0 ), 5.0 ); 17 ThePort.Draw( anArea, aBundle );
Lines 4 and 5: Create an ellipse geometry and add it to the area geometry.
Lines 7 through 12: Create a polygon geometry.
Line 14: Subtract the polygon from the area geometry.
Line 16 : Create an attribute bundle with fill, frame, and pen styles.
Line 17: Send the area and the bundle to the drawing port.