IPointCollection.AddPoint Method的用法

补充指出官方帮助的一个问题。

该方法用于向环、线。面等几何中添加节点。官方帮助里是这样描述的:Adds a vertex to a Path, Ring, Polyline, or Polygon; or adds a reference to the input point to a Multipoint, TriangleFan, or TriangleStrip.

官方给的方法说明如下:

 


[C#]

public void AddPoint (
    IPoint inPoint,
    ref object before,
    ref object after
);
[C#]

Optional Values

before   To indicate that this parameter is undefined, first define a variable object Missing = Type.Missing; then pass this in as ref Missing.
after   To indicate that this parameter is undefined, first define a variable object Missing = Type.Missing; then pass this in as ref Missing.

 
官网示例与网上的分享案例无一例外的只使用了第一个参数,而后两个可选参数被省略或者使用Type.Missing,这样新加的节点添加到几何的最后一个节点之后。能否把第2、3参利用起来,使新加的节点到指定的位置?博主研究了这个可能,得出下面结论。
1、参数类型应为int,其实就是一个index;
2、before意指在给定index指向的节点前加节点,after反之;
3、ref关键字是不需要的。
//before 在这个索引之前加
pointCollection.AddPoint(point,index,Type.Missing);
 

转载于:https://www.cnblogs.com/yzhyingcool/p/11102493.html

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值