dragornuss » 16.08.2005 (Вт) 5:22
Видимо я не совсем точно сформулировал вопрос.
Для начала отрывок кода
В модуле
Public Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long
Public Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Public Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Public Const LF_FACESIZE = 32
Public Type LOGFONT
lfHeight As Long
lfWidth As Long
lfEscapement As Long
lfOrientation As Long
lfWeight As Long
lfItalic As Byte
lfUnderline As Byte
lfStrikeOut As Byte
lfCharSet As Byte
lfOutPrecision As Byte
lfClipPrecision As Byte
lfQuality As Byte
lfPitchAndFamily As Byte
lfFaceName(LF_FACESIZE) As Byte
End Type
В коде формы
Private Sub Form_Load()
Dim RotateMe As LOGFONT
'Set graphic-mode to 'persistent graphic'
pb.AutoRedraw = True
'Rotate degrees
Deg = -50
'Size (in points)
Size = 10
'Set the rotation degree
RotateMe.lfEscapement = Deg * 10
RotateMe.lfFaceName(23) = 3
'Set the height of the font
RotateMe.lfHeight = (Size * -20) / Screen.TwipsPerPixelY
'Здесь создаётся новый шрифт с соответствующими параметрами
'Но в типе LOGFONT нет переменной отвечающей за имя шрифта
'К примеру нужно вывести текст шрифтом OldStyle, а не текущим
'Как это сделать ?
rFont = CreateFontIndirect(RotateMe)
'Здесь Выбираем новый созданный шрифт, как сказано в SelectObject
Curent = SelectObject(pb.hdc, rFont)
'Print some text ...
TextOut pb.hdc, 10, 10, "Igor", 4
End Sub