追风浪子
路人甲
路人甲
  • 注册日期2004-06-08
  • 发帖数166
  • QQ
  • 铜币782枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2416回复:7

如何用MapControl.DrawShape画圆弧

楼主#
更多 发布于:2005-01-13 15:04

这样可以画出polylon
mapcontrol.drawshape(ippolyline2<I></I> as<I></I> igeometry,<I></I> ref<I></I> objlinestyle);
但用同样的方法画圆弧的时候就显示不出来。。。。。
还清高手指教……<img src="images/post/smile/dvbbs/em08.gif" /><img src="images/post/smile/dvbbs/em08.gif" /><img src="images/post/smile/dvbbs/em08.gif" />
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15947
  • QQ554730525
  • 铜币25339枚
  • 威望15364点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2005-01-13 16:43
<P>在arcmap的编辑工具扩展里</P><P>COGO模块里可以画曲线,设置曲线的各种参数</P>
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15947
  • QQ554730525
  • 铜币25339枚
  • 威望15364点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
2楼#
发布于:2005-01-13 16:55
<PRE>下面的程序应该能满足楼猪要求</PRE><PRE> </PRE><PRE> </PRE>
[此贴子已经被作者于2005-1-13 17:01:12编辑过]
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15947
  • QQ554730525
  • 铜币25339枚
  • 威望15364点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
3楼#
发布于:2005-01-13 17:00
<P>Option Explicit
Sub Test()
    Dim pMxDoc As IMxDocument
    Set pMxDoc = ThisDocument
    
    Dim pEnv As IEnvelope
    Set pEnv = pMxDoc.ActiveView.Extent
    pEnv.Expand 0.5, 0.5, True
    
    Dim pPoint As IPoint
    Set pPoint = New Point
    pPoint.PutCoords (pEnv.LowerLeft.x + pEnv.LowerRight.x) / 2#, pEnv.LowerLeft.y
    
    Dim pPolygon As IPolygon
    Set pPolygon = MakeClosedArc(pEnv.LowerLeft, pPoint, pEnv.LowerRight)
    
    With pMxDoc.ActiveView.ScreenDisplay
        .StartDrawing .hDC, esriNoScreenCache
        .SetSymbol New SimpleFillSymbol
        .DrawPolygon pPolygon
        .FinishDrawing
    End With
End Sub</P><P>Private Function MakeClosedArc(pFromPoint As IPoint, _
                               pCenterPoint As IPoint, _
                               pToPoint As IPoint) As IPolygon
    Dim pCArc As ICircularArc
    Set pCArc = New CircularArc
    pCArc.PutCoords pCenterPoint, pFromPoint, pToPoint, esriArcClockwise
  
    Dim pSegColl As ISegmentCollection
    Set pSegColl = New Ring
    pSegColl.AddSegment pCArc
    
    Dim pRing As IRing
    Set pRing = pSegColl
    pRing.Close
    
    Dim pGeomColl As IGeometryCollection
    Set pGeomColl = New Polygon
    pGeomColl.AddGeometry pRing
    Set MakeClosedArc = pGeomColl
    
End Function</P>
举报 回复(0) 喜欢(0)     评分
追风浪子
路人甲
路人甲
  • 注册日期2004-06-08
  • 发帖数166
  • QQ
  • 铜币782枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2005-01-25 21:47
<P>谢谢楼上!</P><P>我将vb的代码转成c#,编译后有些问题不知道怎么解决。。。。</P><P>希望帮帮忙!!!!!    </P><P>ICircularArc ipCircularArc = new CircularArcClass();
    ipCircularArc.PutCoords(ipCenterPoint, ipFormPoint, ipToPoint, esriArcOrientation.esriArcClockwise);</P><P>
    ISegmentCollection ipSegmentCollection = new RingClass();
    ipSegmentCollection.AddSegment(ipCircularArc as ISegment, before,after);  </P><P>//before,after这两个参数怎么设置?
    IRing ipRing = ipSegmentCollection as IRing;
    ipRing.Close();
    IGeometryCollection ipGeometryCollection = new PolygonClass();
    IGeometry[] ipGeom = new RingClass[2];
    ipGeom[0] = new RingClass();
    ipGeom[0] = ipRing;</P><P>    ipGeometryCollection.AddGeometries(count, ipGeom);  
    ipPolygon = ipGeometryCollection as IPolygon;
</P><img src="images/post/smile/dvbbs/em02.gif" /><img src="images/post/smile/dvbbs/em02.gif" /><img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15947
  • QQ554730525
  • 铜币25339枚
  • 威望15364点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
5楼#
发布于:2005-01-26 11:25
这个你就可以看看AddSegment在帮助里的说明了
举报 回复(0) 喜欢(0)     评分
kendomen
路人甲
路人甲
  • 注册日期2004-10-18
  • 发帖数13
  • QQ
  • 铜币163枚
  • 威望0点
  • 贡献值0点
  • 银元0个
6楼#
发布于:2005-01-28 11:01
<P>object pobject = Type.Messing;</P><P>ipSegmentCollection.AddSegment(ipCircularArc as ISegment, ref pobject,ref pobject);  </P>
举报 回复(0) 喜欢(0)     评分
ienown
路人甲
路人甲
  • 注册日期2006-11-14
  • 发帖数23
  • QQ6805791
  • 铜币149枚
  • 威望0点
  • 贡献值0点
  • 银元0个
7楼#
发布于:2008-03-20 18:05
学习,。。。。<img src="images/post/smile/dvbbs/em02.gif" /><img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
游客

返回顶部