TIEPolylineLayer.CalculateCentroid
Declaration
function CalculateCentroid(PointBase: TIEPointBase = iepbRange): TPoint;
Description
Calculates the coordinates of the shape's centroid.
The centroid is the geometric center of a shape, i.e. the mean position of all the points in the figure.
PointBase specifies the
basis of the points. The default is iepbRange, which means the x and y values are in the range 0 to 1000 where (0, 0) is the top-left pixel of the layer and (1000, 1000) is the bottom-right. Values less than 0 or more than 1000 will increase the size of the layer.
Example
// Show area of current polygon in MM
ShowMessage( 'Centroid is ' + IntToStr( TIEPolylineLayer( ImageEnView1.CurrentLayer).CalculateCentroid().X ) + ',' + IntToStr( TIEPolylineLayer( ImageEnView1.CurrentLayer).CalculateCentroid().Y ));
See Also
◼CalculateArea
◼CalculateLength
◼SetScale
◼Dpi
◼MeasureUnits