...或者text控件关于数值旋转九十度的问题,哪位高手能解决,明天中午以 ...

发布网友 发布时间:2小时前

我来回答

1个回答

热心网友 时间: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 = 22 * -20 / Screen.TwipsPerPixelY
.lfWidth = 22 * -20 / Screen.TwipsPerPixelX
.lfEscapement = -90 * 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

看下 应该会有帮助的

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com