Private Sub SaveToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles Savetool.Click
Using bm As New Bitmap(PictureBox1.Image.Clone, PictureBox1.Width, PictureBox1.Height)
SaveFileDialog1.FileName = "Picture 1"
SaveFileDialog1.Filter = "Files|*.jpg;.gif;.bmp"
If SaveFileDialog1.ShowDialog = DialogResult.OK Then
bm.Save(SaveFileDialog1.FileName)
MsgBox("Saved")
bm.Dispose()
End If
End Using
End Sub
当图像很小时,代码可以很好地工作,但是当它变大时会引发异常。
参数无效。