本文整理汇总了C#中IDisplay.DrawMultipoint方法的典型用法代码示例。如果您正苦于以下问题:C# IDisplay.DrawMultipoint方法的具体用法?C# IDisplay.DrawMultipoint怎么用?C# IDisplay.DrawMultipoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDisplay
的用法示例。
在下文中一共展示了IDisplay.DrawMultipoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawGeometry
/// <summary>
/// Draws the input geometry using the specified colors.
/// </summary>
/// <param name="geometry">The input IGeometry to draw. Supported geometry types are GeometryBag, Polygon, Polyline, Point and Multipoint.</param>
/// <param name="fillColor">An IRgbColor reference for the fill color</param>
/// <param name="lineColor">An IRgbColor reference for the line or outline color</param>
/// <param name="display">An IDisplay reference</param>
/// <param name="cancelTracker">An ITrackCancel reference</param>
private static void DrawGeometry(IGeometry geometry, IRgbColor fillColor, IRgbColor lineColor, IDisplay display, ITrackCancel cancelTracker)
{
bool continueDrawing = true;
switch (geometry.GeometryType)
{
case esriGeometryType.esriGeometryBag:
{
IEnumGeometry enumGeometry = (IEnumGeometry)geometry;
IGeometry innerGeometry = enumGeometry.Next();
while (innerGeometry != null && continueDrawing == true)
{
DrawGeometry(innerGeometry, fillColor, lineColor, display, cancelTracker); // Recursive method call
innerGeometry = enumGeometry.Next();
if (cancelTracker != null)
{
continueDrawing = cancelTracker.Continue();
}
}
break;
}
case esriGeometryType.esriGeometryPolygon:
{
// Set the input polygon geometry's symbol.
ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass();
fillSymbol.Color = (IColor)fillColor;
ILineSymbol lineSymbol = new SimpleLineSymbolClass();
lineSymbol.Color = lineColor;
fillSymbol.Outline = lineSymbol;
// Draw the input polygon geometry.
display.SetSymbol((ISymbol)fillSymbol);
display.DrawPolygon(geometry);
break;
}
case esriGeometryType.esriGeometryPolyline:
{
// Set the input polyline geometry's symbol.
IMultiLayerLineSymbol multiLineSymbol = new MultiLayerLineSymbolClass();
ISimpleLineSymbol simpleLineSymbol1 = new SimpleLineSymbolClass();
ISimpleLineSymbol simpleLineSymbol2 = new SimpleLineSymbolClass();
simpleLineSymbol1.Width = 3;
simpleLineSymbol1.Color = fillColor;
simpleLineSymbol2.Width = 5;
simpleLineSymbol2.Color = lineColor;
multiLineSymbol.AddLayer((ILineSymbol)simpleLineSymbol2);
multiLineSymbol.AddLayer((ILineSymbol)simpleLineSymbol1);
// Draw the input polyline geometry.
display.SetSymbol((ISymbol)multiLineSymbol);
display.DrawPolyline(geometry);
break;
}
case esriGeometryType.esriGeometryPoint:
{
// Set the input point geometry's symbol.
ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass();
simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
simpleMarkerSymbol.Size = 12;
simpleMarkerSymbol.Color = fillColor;
simpleMarkerSymbol.Outline = true;
simpleMarkerSymbol.OutlineColor = lineColor;
// Draw the input point geometry.
display.SetSymbol((ISymbol)simpleMarkerSymbol);
display.DrawPoint(geometry);
break;
}
case esriGeometryType.esriGeometryMultipoint:
{
// Set the input multipoint geometry's symbol.
ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass();
simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
simpleMarkerSymbol.Size = 8;
simpleMarkerSymbol.Color = fillColor;
simpleMarkerSymbol.Outline = true;
simpleMarkerSymbol.OutlineColor = lineColor;
// Draw the input multipoint geometry.
display.SetSymbol((ISymbol)simpleMarkerSymbol);
display.DrawMultipoint(geometry);
break;
}
}
}