ESRI.ArcGIS.ADF.Local
GetIPictureDispFromIcon Method
See Also  Send Feedback
ESRI.ArcGIS.ADF.COMSupport Namespace > OLE Class : GetIPictureDispFromIcon Method




icon
A System.Drawing.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 System.Drawing.Icon object.

Return Value

A stdole.StdPicture object.

Example

[C#]
            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;
[Visual Basic .NET]
            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

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2011 All Rights Reserved.