主题:请各楼主帮忙修改一下程序!无比感谢!
[color=FF0000]我想实现把所有字数的单行文本转化成一幅所有字数的图片,怎样修改?现在是能转换,但当字数超过文本框的字数时,图片不完整,谢谢各位,[/color]
Private Sub Command1_Click()
'把文本内容保存为c:\111.bmp
Dim ctlNew As Control
'动态创建一个PICTUREBOX控件。
'然后设置PictureBox对象的一些属性
Set ctlNew = Me.Controls.Add("VB.PictureBox", "picNew", Me)
ctlNew.AutoRedraw = True
ctlNew.AutoSize = True
ctlNew.Width = Text1.Width
ctlNew.Height = Text1.Height / 2
ctlNew.BackColor = vbWhite
ctlNew.FontSize = 16 '字体大小
ctlNew.ForeColor = vbGreen
ctlNew.Print Text1.Text '将文本框的内容输出到PictureBox对象里
ctlNew.Picture = ctlNew.Image '可要可不要,刷新PICTURE属性
SavePicture ctlNew.Picture, "c:\111.bmp"
MsgBox "文件转换完毕!"
End Sub
[em18][em18][em18][em18][em18]
Private Sub Command1_Click()
'把文本内容保存为c:\111.bmp
Dim ctlNew As Control
'动态创建一个PICTUREBOX控件。
'然后设置PictureBox对象的一些属性
Set ctlNew = Me.Controls.Add("VB.PictureBox", "picNew", Me)
ctlNew.AutoRedraw = True
ctlNew.AutoSize = True
ctlNew.Width = Text1.Width
ctlNew.Height = Text1.Height / 2
ctlNew.BackColor = vbWhite
ctlNew.FontSize = 16 '字体大小
ctlNew.ForeColor = vbGreen
ctlNew.Print Text1.Text '将文本框的内容输出到PictureBox对象里
ctlNew.Picture = ctlNew.Image '可要可不要,刷新PICTURE属性
SavePicture ctlNew.Picture, "c:\111.bmp"
MsgBox "文件转换完毕!"
End Sub
[em18][em18][em18][em18][em18]