本文整理汇总了C#中PolylineClass.SetEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# PolylineClass.SetEmpty方法的具体用法?C# PolylineClass.SetEmpty怎么用?C# PolylineClass.SetEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolylineClass
的用法示例。
在下文中一共展示了PolylineClass.SetEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
internal void Draw()
{
if (Map == null)
return;
var view = Map as IActiveView;
if (view == null)
return;
var container = Map as IGraphicsContainer;
if (container == null)
return;
IPoint point1 = new PointClass();
IPoint point2 = new PointClass();
IPolyline line = new PolylineClass();
//erase all elements in the group.
_group.ClearElements();
//add vertical lines to the group
point1.Y = Extents.YMin;
point2.Y = Extents.YMax;
for (int i = 0; i <= ColumnCount; i++)
{
point1.X = Extents.XMin + ColumnWidth * i;
point2.X = point1.X;
line.SetEmpty();
((IPointCollection)line).AddPoint(point1);
((IPointCollection)line).AddPoint(point2);
DrawLine(_group, line);
}
//add horizontal lines to the group
point1.X = Extents.XMin;
point2.X = Extents.XMax;
for (int j = 0; j <= RowCount; j++)
{
point1.Y = Extents.YMin + RowHeight * j;
point2.Y = point1.Y;
line.SetEmpty();
((IPointCollection)line).AddPoint(point1);
((IPointCollection)line).AddPoint(point2);
DrawLine(_group, line);
}
//Add labels to the group
for (int row = 0; row < RowCount; row++)
{
for (int column = 0; column < ColumnCount; column++)
{
point1.X = Extents.XMin + ColumnWidth * (column + 0.5f);
point1.Y = Extents.YMin + RowHeight * (row + 0.5f);
string label = GetLabel(row, column);
DrawLabel(_group, label, point1);
}
}
//refresh the display
container.UpdateElement(_group as IElement);
view.ScreenDisplay.FinishDrawing();
view.Refresh();
}