Knowledge Base Article
KB10342 - How can I add pie-piece shapped figures/objects to my map layer?
There are two options for creating such pie-piece shaped (or any other shapped) objects in a DK application:
1) Draw this on your own by rendering a pie-piece shape using a series of lines, like this:
shp->Lock() ;
shp->Reset() ;
shp->AddPoint( GisPoint() )
shp->AddPoint( GisPoint() )
shp->Unlock()
2) Override OnPaintShape event (See samples #1 BitmapFill)
ll->OnPaintShape = PaintShape ;
void __fastcall TForm1::PaintShape( const TObject *_sender, const TGIS_Shape
*_shape )
{
TPoint pt ;
pt = GIS->ScreenToMap( _shape.Centroid ) ; // so we know the postion
// how to convert map units (distance) to screen units
screen_distance = map_distance * GIS->Zoom ;
// and now you will know how to draw Pie using Canvas
_shape->Layer->Viewer->Canvas->Pie( ... ) ;
}
Created: 2003-11-21, Modified: 2005-09-14
|