如何在VB中设置字体的水平方向的缩放,并用打印机打出来
答案:2 悬赏:70
解决时间 2021-02-14 13:49
- 提问者网友:清茶柒夏
- 2021-02-14 03:47
如何在VB中设置字体的水平方向的缩放,并用打印机打出来
最佳答案
- 二级知识专家网友:爱情是怎么炼成的
- 2021-02-14 04:12
不能。
除非将文字显示到 PictureBox 上成为图片,然后横向缩放该图片,再用打印机打印。但效果会很差。
补充:
朋友,你发给我的的消息说,PictureBox 不能缩放图片,未免太武断了吧。我缩放给你看:
缩放PictureBox 控件图片
'例子需控件 Picture1、Picture2
Private Sub Form_Load()
Picture1.Cls: Picture1.AutoRedraw = True
Picture1.Picture = Me.Icon '也可以装载图片文件:Picture1.Picture =LoadPicture("C:\my.bmp")
Picture1.Font.Bold = True: Picture1.BackColor = &HFFFFFF
Picture1.Font.Size = 72: Picture1.Print "缩放"
Set Picture1.Picture = Picture1.Image
Picture2.AutoRedraw = True
Me.Caption = "在上图单击鼠标:左击缩小,右击放大"
Picture1.Move 0, 0: Picture2.Move 0, Picture1.Top + Picture1.Height
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim W As Single, H As Single
Static BiW As Single, BiH As Single
If BiW = 0 Then BiW = 1
If BiH = 0 Then BiH = 1
If Button = 1 Then BiW = BiW * 0.75 Else BiW = BiW * 1.25 '横向缩放比列
' If Button = 1 Then BiH = BiH * 0.75 Else BiH = BiH * 1.25 '纵向缩放比列
W = Picture1.Width: H = Picture1.Height
Picture2.Cls
If W * BiW < Screen.TwipsPerPixelX Then Exit Sub
If H * BiH < Screen.TwipsPerPixelY Then Exit Sub
Picture2.PaintPicture Picture1.Picture, 0, 0, W * BiW, H * BiH, 0, 0, W, H
End Sub
除非将文字显示到 PictureBox 上成为图片,然后横向缩放该图片,再用打印机打印。但效果会很差。
补充:
朋友,你发给我的的消息说,PictureBox 不能缩放图片,未免太武断了吧。我缩放给你看:
缩放PictureBox 控件图片
'例子需控件 Picture1、Picture2
Private Sub Form_Load()
Picture1.Cls: Picture1.AutoRedraw = True
Picture1.Picture = Me.Icon '也可以装载图片文件:Picture1.Picture =LoadPicture("C:\my.bmp")
Picture1.Font.Bold = True: Picture1.BackColor = &HFFFFFF
Picture1.Font.Size = 72: Picture1.Print "缩放"
Set Picture1.Picture = Picture1.Image
Picture2.AutoRedraw = True
Me.Caption = "在上图单击鼠标:左击缩小,右击放大"
Picture1.Move 0, 0: Picture2.Move 0, Picture1.Top + Picture1.Height
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim W As Single, H As Single
Static BiW As Single, BiH As Single
If BiW = 0 Then BiW = 1
If BiH = 0 Then BiH = 1
If Button = 1 Then BiW = BiW * 0.75 Else BiW = BiW * 1.25 '横向缩放比列
' If Button = 1 Then BiH = BiH * 0.75 Else BiH = BiH * 1.25 '纵向缩放比列
W = Picture1.Width: H = Picture1.Height
Picture2.Cls
If W * BiW < Screen.TwipsPerPixelX Then Exit Sub
If H * BiH < Screen.TwipsPerPixelY Then Exit Sub
Picture2.PaintPicture Picture1.Picture, 0, 0, W * BiW, H * BiH, 0, 0, W, H
End Sub
全部回答
- 1楼网友:风格单纯
- 2021-02-14 04:57
搜一下:如何在VB中设置字体的水平方向的缩放,并用打印机打出来
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯
• 手机登qq时,显示手机磁盘不足,清理后重新登 |
• 刺客的套装怎么选啊? |