vb中如何让picturebox画出的图形保存为图片格式
问:我在picturebox控件中用line\circle等绘图命令画出图形后,希望将得到的图形保存为jpg\gif等图片格式,如何实现?请教各位大虾们!:)谢!!
pls:用如下程序得到的只是空白图。请大虾们看看我下面的程序有什么问题:)
Private Sub Command2_Click()
Call SavePic("D:\毕设答辩准备\vb\vb保存pic", "good.jpg")
End Sub
Public Function SavePic(PicPath As String, PicName As String)
'调用绘图程序来保存图片
Dim RTV
Dim i, j As Integer
Dim fso As New FileSystemObject
RTV = Shell("mspaint.exe", vbMaximizedFocus) ' 激活绘图程序。
'Sleep (1000)
AppActivate RTV, True
SendKeys "^v", True '粘贴完毕
SendKeys "%f", True '保存图片
SendKeys "^a", True
SendKeys PicPath & "\" & PicName, True '保存路径和名称
If fso.FileExists(PicPath & "\" & PicName) = True Then '检测图片是否存在
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{ENTER}", True
SendKeys "{TAB}", True
SendKeys "{ENTER}", True
Else
SendKeys "{ENTER}", False
SendKeys "{ENTER}", False
End If
SendKeys "%{F4}", True
Clipboard.Clear
End Function