Hi Ray
For elliptical and rectangular measurement you are better to use a TIETextLayer with a visible BorderShape.
Compare the following:
// THREE WAYS TO CALCULATE PERIMETER AND AREA OF AN ELLIPSE
// 1. Shape Layer
ImageEnView1.LayersAdd( iesEllipse, 10, 10, 400, 250 );
ImageEnView1.CurrentLayer.RulerUnits := ieuPixels;
memo1.Lines.Add( 'Shape Perim : ' + FloatToStr( ImageEnView1.CurrentLayer.RulerValue( ierLength )));
memo1.Lines.Add( 'Shape Area : ' + FloatToStr( ImageEnView1.CurrentLayer.RulerValue( ierArea )));
// 2. Text Layer
ImageEnView1.LayersAdd( ielkText, 10, 410, 400, 250 );
ImageEnView1.CurrentLayer.FillColor := clRed;
ImageEnView1.CurrentLayer.RulerUnits := ieuPixels;
ImageEnView1.CurrentLayer.RulerMode := iermLabel;
TIETextLayer( ImageEnView1.CurrentLayer ).BorderShape := iesEllipse;
memo1.Lines.Add( 'Text Perim : ' + FloatToStr( ImageEnView1.CurrentLayer.RulerValue( ierLength )));
memo1.Lines.Add( 'Text Area : ' + FloatToStr( ImageEnView1.CurrentLayer.RulerValue( ierArea )));
// 3. Polyline Layer (less accurate)
ImageEnView1.LayersAdd( iesEllipse, 10, 810, 400, 250 );
TIEShapeLayer( ImageEnView1.CurrentLayer ).ConvertToPolylineLayer();
IEGlobalSettings().LayerCurveQuality := 36; // Less points to reduce complexity
memo1.Lines.Add( 'Poly Perim : ' + FloatToStr( TIEPolylineLayer( ImageEnView1.CurrentLayer ).CalculateLength( ieuPixels )));
memo1.Lines.Add( 'Poly Area : ' + FloatToStr( TIEPolylineLayer( ImageEnView1.CurrentLayer ).CalculateArea( ieuPixels )));
ImageEnView1.Update;
{ Returns:
Shape Perim : 1047.851
Shape Area : 78539.816
Text Perim : 1047.851
Text Area : 78539.816
Poly Perim : 1028.604
Poly Area : 77512.826
}
Please see: https://www.imageen.com/help/TIELayer.RulerValue.html
But note that documentation is outdated as now all layer types support ierArea and ierLength.
Nigel
Xequte Software
www.imageen.com