Ellipse ellipse = map.TrackCircle(); TheCakeIsReal(ellipse.Center, ellipse.radius);
IPolygon polygon = mapControl.TrackCircle() as IPolygon; CircularArc circularArc = polygon as CircularArc; CircleElement circleElement = polygon as CircleElement; RubberCircle rubberCircle = polygon as RubberCircle; //... circularArc.CenterPoint ? //... circularArc.Radius ?
Solved! Go to Solution.
IGeometry geometry = mapControl.TrackCircle();
if (geometry.GeometryType == esriGeometryType.esriGeometryPolygon)
{
Polygon polygon = geometry as Polygon;
if (polygon.PointCount == 2)
{
string polyInfoStr = String.Format("Point 1 : [{0:f2}, {1:f2}]\nPoint 2 : [{2:f2},{3:f2}]", polygon.Point[0].X, polygon.Point[0].Y, polygon.Point[1].X, polygon.Point[1].Y);
MessageBox.Show(polyInfoStr);
}
}
IGeometry geometry = mapControl.TrackLine();
IPointCollection pointCollection = geometry as IPointCollection;
StringBuilder pointsInfoStr = new StringBuilder();
for (int pointIndex = 0; pointIndex < pointCollection.PointCount; pointIndex++)
{
IPoint curPoint = pointCollection.Point[pointIndex];
string pointInfo = String.Format("Point {0} : [{1:f2}, {2:f2}]", pointIndex + 1, curPoint.X, curPoint.Y);
pointsInfoStr.AppendLine(pointInfo);
}
MessageBox.Show(pointsInfoStr.ToString());
IGeometry geometry = mapControl.TrackCircle(); double radius = geometry.Envelope.Width / 2; IPoint centroid = ((EnvelopeClass)geometry.Envelope).Centroid;