B
Benjamin Lukner
Hi!
I'm trying to use ExtTextOut with WinCE 4.1.
CreateFont is not supported, so I obvously have to use
CreateFontIndirect. But I still have problems with structures under
VB.Net. The following code doesn't work (NotSupportedException).
Does anyone know how to do it right?
<System.Runtime.InteropServices.structlayout _
(Runtime.InteropServices.LayoutKind.Sequential)> _
Private Structure LogFont
Dim nHeight As Int32
Dim nWidth As Int32
Dim nEscapement As Int32
Dim nOrientation As Int32
Dim fnWeight As Int32
Dim fdwItalic As Byte
Dim fdwUnderline As Byte
Dim fdwStrikeOut As Byte
Dim fdwCharSet As Byte
Dim fdwOutputPrecision As Byte
Dim fdwClipPrecision As Byte
Dim fdwQuality As Byte
Dim fdwPitchAndFamily As Byte
<VBFixedString(32)> Dim lpszFace As String
End Structure
Private Declare Function CreateFontIndirect _
Lib "CoreDLL.dll" _
Alias "CreateFontA" ( _
ByVal lplf As LogFont _
) As IntPtr
Dim hObject As IntPtr
Dim uFont As LogFont
With uFont
.nWidth = 10
.nHeight = 20
.nEscapement = 0
.nOrientation = 0
.fnWeight = 0
.fdwItalic = 0
.fdwUnderline = 0
.fdwStrikeOut = 0
.fdwCharSet = DEFAULT_CHARSET
.fdwOutputPrecision = OUT_TT_PRECIS
.fdwClipPrecision = CLIP_DEFAULT_PRECIS
.fdwQuality = ANTIALIASED_QUALITY
.fdwPitchAndFamily = FIXED_PITCH
.lpszFace = "Courier New"
End With
hObject = CreateFontIndirect(uFont)
Kind regards,
Benjamin Lukner
I'm trying to use ExtTextOut with WinCE 4.1.
CreateFont is not supported, so I obvously have to use
CreateFontIndirect. But I still have problems with structures under
VB.Net. The following code doesn't work (NotSupportedException).
Does anyone know how to do it right?
<System.Runtime.InteropServices.structlayout _
(Runtime.InteropServices.LayoutKind.Sequential)> _
Private Structure LogFont
Dim nHeight As Int32
Dim nWidth As Int32
Dim nEscapement As Int32
Dim nOrientation As Int32
Dim fnWeight As Int32
Dim fdwItalic As Byte
Dim fdwUnderline As Byte
Dim fdwStrikeOut As Byte
Dim fdwCharSet As Byte
Dim fdwOutputPrecision As Byte
Dim fdwClipPrecision As Byte
Dim fdwQuality As Byte
Dim fdwPitchAndFamily As Byte
<VBFixedString(32)> Dim lpszFace As String
End Structure
Private Declare Function CreateFontIndirect _
Lib "CoreDLL.dll" _
Alias "CreateFontA" ( _
ByVal lplf As LogFont _
) As IntPtr
Dim hObject As IntPtr
Dim uFont As LogFont
With uFont
.nWidth = 10
.nHeight = 20
.nEscapement = 0
.nOrientation = 0
.fnWeight = 0
.fdwItalic = 0
.fdwUnderline = 0
.fdwStrikeOut = 0
.fdwCharSet = DEFAULT_CHARSET
.fdwOutputPrecision = OUT_TT_PRECIS
.fdwClipPrecision = CLIP_DEFAULT_PRECIS
.fdwQuality = ANTIALIASED_QUALITY
.fdwPitchAndFamily = FIXED_PITCH
.lpszFace = "Courier New"
End With
hObject = CreateFontIndirect(uFont)
Kind regards,
Benjamin Lukner