本文整理汇总了C#中Polyline.AddGeometry方法的典型用法代码示例。如果您正苦于以下问题:C# Polyline.AddGeometry方法的具体用法?C# Polyline.AddGeometry怎么用?C# Polyline.AddGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polyline
的用法示例。
在下文中一共展示了Polyline.AddGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: drawLineGraphic
private void drawLineGraphic(double Size, bool bHor = true)
{
IMxDocument pMxDoc = m_pDoc;
IActiveView pActiveView;
IScreenDisplay pScreenDisplay;
IEnvelope pEnv;
IPoint pCenterPoint;
IDisplayTransformation pTransform;
pActiveView = pMxDoc.FocusMap as IActiveView;
pScreenDisplay = pActiveView.ScreenDisplay;
pTransform = pScreenDisplay.DisplayTransformation;
pEnv = pTransform.FittedBounds;
pCenterPoint = new Point();
pCenterPoint.PutCoords((pEnv.XMax + pEnv.XMin) / 2, (pEnv.YMax + pEnv.YMin) / 2);
ILine pLine;
IPolyline pPolyline;
IGeometryCollection pGeomColl;
ISegmentCollection pSegColl;
Size /= 2;
IPoint pPointFrom;
IPoint pPointTo;
pSegColl = new Path() as ISegmentCollection;
pGeomColl = new Polyline() as IGeometryCollection;
// UN
pPointFrom = new Point();
if (bHor) { pPointFrom.PutCoords(pCenterPoint.X - Size, pCenterPoint.Y); }
else { pPointFrom.PutCoords(pCenterPoint.X, pCenterPoint.Y - Size); }
pPointTo = new Point();
if (bHor) { pPointTo.PutCoords(pCenterPoint.X + Size, pCenterPoint.Y); }
else { pPointTo.PutCoords(pCenterPoint.X, pCenterPoint.Y + Size); }
pLine = new Line();
pLine.PutCoords(pPointFrom, pPointTo);
pSegColl.AddSegment(pLine as ISegment);
// Add to final
pGeomColl.AddGeometry(pSegColl as IGeometry);
pPolyline = pGeomColl as IPolyline;
IRgbColor pLineColor = new RgbColor();
pLineColor.Red = 255; // A CHANGER!!!
addGraphicToMap(pMxDoc.FocusMap, pPolyline, pLineColor, pLineColor);
pPointFrom = null;
pPointTo = null;
pLine = null;
pPolyline = null;
pGeomColl = null;
pSegColl = null;
}