This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IM > IMapControl2 Interface > IMapControl2.DrawShape Method (ArcObjects .NET 10.5 SDK) |
Draws a geometry shape on the MapControl.
[Visual Basic .NET] Public Sub DrawShape ( _ ByVal Shape As IGeometry, _ [ByRef symbol As Object] _ )
[C#] public void DrawShape ( IGeometry Shape, ref object symbol );
Optional Values
[C++]
HRESULT DrawShape(
IGeometry* Shape,
VARIANT* symbol
);
[C++]
Parameters Shape [in]
Shape is a parameter of type IGeometry symbol [optional] symbol is a parameter of type VARIANT
To indicate this parameter is undefined pass a reference to a VARIANT with type VT_ERROR and scode value of DISP_E_PARAMNOTFOUND.
1025 800a0401: The specified symbol does not indicate the correct type of object
1030 800a0406: The supplied geometry does not have a geometry type that is supported for drawing
Geometry objects implementing IEnvelope, IMultiPatch, IMultiPoint, IPoint, IPolygon and IPolyline are supported.
private void axMapControl1_OnAfterDraw(object sender, ESRI.ArcGIS.MapControl.IMapControlEvents2_OnAfterDrawEvent e)
{
if (e.viewDrawPhase == (int) esriViewDrawPhase.esriViewForeground)
{
//Use DrawShape...
}
}
Private Sub AxMapControl1_OnAfterDraw(ByVal sender As Object, ByVal e As ESRI.ArcGIS.MapControl.IMapControlEvents2_OnAfterDrawEvent) Handles AxMapControl1.OnAfterDraw
If e.viewDrawPhase=esriViewDrawPhase.esriViewForeground Then
'Use DrawShape...
End If
End Sub
IMapControl2 Interface | IMapControl3.DrawText Method | IMapControl2.DrawText Method | IMapControl4.DrawText Method | IMapControl3.FlashShape Method | IMapControl4.FlashShape Method | IMapControl2.FlashShape Method