Drawing3d documented Class Library

FeaturesW32.GetTextExtentPoint32 Method

Call this member function to compute the width and height of a line of text using the current font to determine the dimensions.

[Visual Basic]
<PreserveSig> _
<DllImport(EntryPoint:="GetTextExtentPoint32", CharSet:=CharSet.Auto, SetLastError:=False, ExactSpelling:=False, PreserveSig:=True, CallingConvention:=CallingConvention.Winapi, BestFitMapping:=False, ThrowOnUnmappableChar:=False, Value:="gdi32.dll")> _
Public Shared Sub GetTextExtentPoint32( _
   ByVal hDC As IntPtr, _
   ByVal lpsz As String, _
   ByVal cbString As Integer, _
   ByRef lpSize As Point _
)
[C#]
[PreserveSig]
[DllImport(EntryPoint="GetTextExtentPoint32", CharSet=CharSet.Auto, SetLastError=False, ExactSpelling=False, PreserveSig=True, CallingConvention=CallingConvention.Winapi, BestFitMapping=False, ThrowOnUnmappableChar=False, Value="gdi32.dll")]
public static int GetTextExtentPoint32(
   IntPtr hDC,
   string lpsz,
   int cbString,
   ref Point lpSize
);

Parameters

hDC
Device context
lpsz
The text
cbString
Specifies the number of characters in the string.
lpSize
You get the size of the text

Return Value

See Also

FeaturesW32 Class | Drawing3d.OS.Windows Namespace