vb如何将在窗体上绘画的图像(三角函数)使用通用对话框保存为文件

如题所述

Dim filename As String
CommonDialog1.DialogTitle = "请选择要另存的文件名"
CommonDialog1.InitDir = "c:\" '缺省打开路径
CommonDialog1.Filter = "*.bmp|图像文件"
CommonDialog1.FilterIndex = 0
CommonDialog1.ShowSave '保存文件
filename = CommonDialog1.filename '文件名
If filename <> "" Then
If Right(filename, 4) = ".bmp" Then
SavePicture Pic1.Image, filename
Else
SavePicture Pic1.Image, filename & ".bmp"
End If
End If

追问

SavePicture Pic1.Image, filename
我问一下,你是不是中间用了image这个控件?按照你写的代码,我的这里显示没有对象……

问一下,SavePicture Pic1.Image, filename,这个中的Pic1.image 指的是什么?

追答

我用的picture控件,名字命名为pic1了

追问

谢谢。我已经能会了

追答

还请采纳我的回答哦

温馨提示:答案为网友推荐,仅供参考
相似回答