标题:请问在picturebox中print 文字要求旋转怎么做
只看楼主
常模块
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2023-3-19
结帖率:100%
已结贴  问题点数:20 回复次数:3 
请问在picturebox中print 文字要求旋转怎么做
做一个纸盒展开图标注尺寸,但是数值(30cm)不会旋转
搜索更多相关主题的帖子: 文字 print picturebox 要求 旋转 
2023-03-19 12:57
mrexcel
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:22
帖 子:125
专家分:480
注 册:2022-11-3
得分:20 
程序代码:
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(31) 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 = 1
End With

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

With Picture1
.AutoRedraw = False
.Cls
.CurrentX = .ScaleWidth / 3
.CurrentY = .ScaleHeight / 1.5
End With
Picture1.Print "30cm"

SelectObject Me.Picture1.hdc, hOldFont
DeleteObject hFont

End Sub
收到的鲜花
  • 常模块2023-03-19 19:24 送鲜花  2朵  
2023-03-19 16:45
cuituo
Rank: 2
等 级:论坛游民
威 望:2
帖 子:15
专家分:11
注 册:2008-6-21
得分:0 
确实是只能旋转打印图片
2023-03-19 17:55
常模块
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2023-3-19
得分:0 
回复 2楼 mrexcel
懂了,谢谢大佬解答
2023-03-19 19:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-511596-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.319294 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved