| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 868 人关注过本帖
标题:请问在picturebox中print 文字要求旋转怎么做
只看楼主 加入收藏
常模块
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2023-3-19
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:3 
请问在picturebox中print 文字要求旋转怎么做
做一个纸盒展开图标注尺寸,但是数值(30cm)不会旋转
搜索更多相关主题的帖子: 文字 print picturebox 要求 旋转 
2023-03-19 12:57
mrexcel
Rank: 6Rank: 6
等 级:贵宾
威 望:22
帖 子:126
专家分: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
帖 子:28
专家分:22
注 册:2008-6-21
收藏
得分:0 
确实是只能旋转打印图片
2023-03-19 17:55
常模块
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2023-3-19
收藏
得分:0 
回复 2楼 mrexcel
懂了,谢谢大佬解答
2023-03-19 19:23
快速回复:请问在picturebox中print 文字要求旋转怎么做
数据加载中...
 
   



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

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