vb:怎么保存picturebox上面shape输出的图形

来源:百度知道 编辑:UC知道 时间:2024/05/14 14:37:16
用line方法在picturebox画了个图形,想保存一下。
要求,单击按钮,出现保存对话框。可以改变图片名字,可以改变路径

添加部件: Microsoft Common Dialog Control
并添加这个控件到窗体中

编写按钮的单击事件代码:

Private Sub Command1_Click()
With CommonDialog1
.FileName = ""
.Filter = "位图文件(*.bmp)|*.bmp"
.ShowSave
If Len(.FileName) > 0 Then
SavePicture Picture1.Image, .FileName
End If
End With
End Sub

可以将图片框(Picture1)中的内容保存