• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

gisoracle

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

arcgis 画椭圆

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

posted on 2010-09-16 08:47  gisai  阅读(3604)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3