ESRI.ArcGIS.ADF
GetIPictureDispFromIcon Method
See Also  Example Send comments on this topic.
ESRI.ArcGIS.ADF.COMSupport Namespace > OLE Class : GetIPictureDispFromIcon Method




icon
A Icon object.
The GetIPictureDispFromIcon method can be used to convert an existing .NET System.Drawing.Icon object into a Stdole.StdPicture object.

Syntax

Visual Basic (Declaration) 
Public Shared Function GetIPictureDispFromIcon( _
   ByVal icon As Icon _
) As Object
Visual Basic (Usage)Copy Code
Dim icon As Icon
Dim value As Object
 
value = OLE.GetIPictureDispFromIcon(icon)
C# 
public static object GetIPictureDispFromIcon( 
   Icon icon
)

Parameters

icon
A Icon object.

Return Value

A stdole.StdPicture object.

Example

[C#]
[Visual Basic .NET]
C#Copy Code
System.Drawing.Icon dotNetIcon = new System.Drawing.Icon(@"C:\Temp\MyIcon.ico"); 

ESRI.ArcGIS.MapControl.IMapControlDefault  map = this.axMapControl1.Object as ESRI.ArcGIS.MapControl.IMapControlDefault; 

map.MouseIcon = ESRI.ArcGIS.Utility.COMSupport.OLE.GetIPictureDispFromIcon(dotNetIcon) as stdole.IPictureDisp; 

map.MousePointer = ESRI.ArcGIS.SystemUI.esriControlsMousePointer.esriPointerCustom;
C#Copy Code
Dim dotNetIcon As System.Drawing.Icon = New System.Drawing.Icon("C:\Temp\MyIcon.ico") 

Dim map As ESRI.ArcGIS.MapControl.IMapControlDefault = Me.AxMapControl1.Object 

map.MouseIcon = ESRI.ArcGIS.Utility.COMSupport.OLE.GetIPictureDispFromIcon(dotNetIcon) 

map.MousePointer = ESRI.ArcGIS.SystemUI.esriControlsMousePointer.esriPointerCustom

See Also

© 2010 All Rights Reserved.