The GetIFontDispFromFont method can be used to convert an existing .NET System.Drawing.Font object into a Stdole.StdFont object.
Syntax
Visual Basic (Declaration) | |
---|
Public Shared Function GetIFontDispFromFont( _
ByVal font As Font _
) As Object |
Visual Basic (Usage) | Copy Code |
---|
Dim font As Font
Dim value As Object
value = OLE.GetIFontDispFromFont(font) |
Parameters
- font
- A System.Drawing.Font object.
Return Value
A stdole.StdFont object.
Example
[C#] System.Drawing.Font dotNetFont = new System.Drawing.Font("Castellar", 25.0F);
ESRI.ArcGIS.Display.ITextSymbol textSym = new ESRI.ArcGIS.Display.TextSymbolClass() as ESRI.ArcGIS.Display.ITextSymbol;
textSym.Font = ESRI.ArcGIS.Utility.COMSupport.OLE.GetIFontDispFromFont(dotNetFont) as stdole.IFontDisp;
[Visual Basic .NET] Dim dotNetFont As New System.Drawing.Font("Castellar", 25.0F)
Dim textSym As ESRI.ArcGIS.Display.ITextSymbol = New ESRI.ArcGIS.Display.TextSymbolClass
textSym.Font = ESRI.ArcGIS.Utility.COMSupport.OLE.GetIFontDispFromFont(dotNetFont)
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