I have a Bitmap object within my app named canvas. How would I go about saving canvas as an image to the path specified by my SaveFileDialog?
Printable View
I have a Bitmap object within my app named canvas. How would I go about saving canvas as an image to the path specified by my SaveFileDialog?
Or I can stop being stupid and look at the methods for the Bitmap object... too easy.
Use the Save method of the bitmap object. You can pass in a filepath and specify the image format too. Something like this
c# Code:
if (SaveFileDialog1.ShowDialog = System.Windows.Forms.DialogResult.OK) { canvas.Save(SaveFileDialog1.Filename, System.Drawing.Imaging.ImageFormat.Jpeg); }
Edit: Ooopssss.... You've already found the answer. Good job!