冬天有蚂蚁吗:vb显示旋转字

来源:百度文库 编辑:高考问答 时间:2024/05/01 04:42:32
各位大哥大姐 小弟遇到问题了 帮个忙吧 我想把vb 中 在文本框中输入的一句话 (大约 6-10个字) 在窗口上 以一定的角度 输出为半环形的 就像 输出了一个 扇子面 一样 谁能帮帮我啊 最好提供 全部 或部分源代码 和 命令 及相应的参数
能否说的 更详细一些 谢谢

Private Const LF_FACESIZE = 32
Private Const DEFAULT_CHARSET = 1

Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long

Private 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(0 To LF_FACESIZE - 1) As Byte
End Type

Private Sub Command1_Click()
Dim TFont As LOGFONT
Dim hOldFont As Long, hFont As Long

With TFont
.lfHeight = 32 * -20 / Screen.TwipsPerPixelY
.lfWidth = 32 * -20 / Screen.TwipsPerPixelX
.lfEscapement = 45 * 10
.lfWeight = 700
.lfCharSet = DEFAULT_CHARSET
End With

hFont = CreateFontIndirect(TFont)
hOldFont = SelectObject(Me.Picture1.hdc, hFont)

With Me.Picture1
.AutoRedraw = False
.Cls
.CurrentX = .ScaleWidth / 2
.CurrentY = .ScaleHeight / 2
End With
Picture1.Print "aa"

SelectObject Me.Picture1.hdc, hOldFont
DeleteObject hFont

End Sub