arcgis 画椭圆
一个椭圆
Public Function CreateEArcFull(pEnv As IEnvelope) As IEllipticArc
Dim pConstEArc As IConstructEllipticArc
Set pConstEArc = New EllipticArc
pConstEArc.ConstructEnvelope pEnv
Set CreateEArcFull = pConstEArc
End Function
参照例子代码:
public void ShowEllipticArcProperties()
{
// Get the Application Handle and the display
//Use IEllipticArc.PutCoords to Input the Center, Start and End points to create an EllipticArc.
IPoint startPoint = new PointClass();
startPoint.PutCoords(100, 100);
IPoint centerPoint = new PointClass();
centerPoint.PutCoords(250, 100);
IPoint endPoint = new PointClass();
endPoint.PutCoords(400, 100);
IEllipticArc ellipticArc = new EllipticArcClass();
//Draw a Elliptic arc with Solid line symbol.
ellipticArc.PutCoords(false, centerPoint, startPoint, endPoint, Math.PI, 1 / 3, esriArcOrientation.esriArcClockwise);
//Display arc
ISimpleLineSymbol symbol = new SimpleLineSymbol();
symbol.Style = esriSimpleLineStyle.esriSLSDot;
IMxApplication mxApplication = m_application as IMxApplication;
IDisplay display = mxApplication.Display;
DisplayArc(mxApplication, display as IScreenDisplay, ellipticArc, symbol as ISymbol);
//Use IEllipticArc.QueryCoords to get the statistics of the elliptic arc.
System.Windows.Forms.MessageBox.Show("The statistics of the Elliptic arc are: " +"\n"+
"Center Point : " +"\n"+
" X coord: " + ellipticArc.CenterPoint.X +"\n"+
" Y coord: " + ellipticArc.CenterPoint.Y +"\n"+
"IsCircular: " + ellipticArc.IsCircular +"\n"+
"From Angle: " + ellipticArc.get_FromAngle(false) +"\n"+
"Central Angle: " + ellipticArc.CentralAngle +"\n"+
"To Angle: " + ellipticArc.get_ToAngle(false) +"\n"+
"IsLine: " + ellipticArc.IsLine +"\n"+
"IsPoint: " + ellipticArc.IsPoint +"\n"+
"IsMinor: " + ellipticArc.IsMinor +"\n"+
"IsCCW: " + ellipticArc.IsCounterClockwise
);
}
private void DisplayArc(IMxApplication mxApplication, IScreenDisplay sreenDisplay, IEllipticArc ellipticArc, ISymbol lineSymbol)
{
short oldActiveCache = sreenDisplay.ActiveCache;
//Add the new arc to a segment collection.
ISegment segment = ellipticArc as ISegment;
ISegmentCollection polyline = new Polyline() as ISegmentCollection;
object Missing = Type.Missing;
polyline.AddSegment(segment, ref Missing, ref Missing);
sreenDisplay.ActiveCache = (short)esriScreenCache.esriNoScreenCache;
sreenDisplay.StartDrawing(mxApplication.Display.hDC, (short)esriScreenCache.esriNoScreenCache);
sreenDisplay.SetSymbol(lineSymbol);
sreenDisplay.DrawPolyline(polyline as IGeometry);
sreenDisplay.FinishDrawing();
sreenDisplay.ActiveCache = oldActiveCache;
}
来自http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=4981&pid=70537&page=1&extra=#pid70537