I want to save pictures (bitmap-graphics)

  • Thread starter Thread starter DSchlichte
  • Start date Start date
D

DSchlichte

Hello

' I need some help. I've created a little application to paint, save and
load pictures (Bitmap-graphics) into
' a picturebox-object on the desktop. There's no problem to paint or to load
pictures, but how can I save the image?

' My load-routine is the following (if I click on the file-menu and chose
File open...):

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem2.Click

OpenFileDialog1.Title = "Datei öffnen..."

OpenFileDialog1.Filter = "Windows-Bitmap|*.bmp"

OpenFileDialog1.FilterIndex = 1

OpenFileDialog1.ShowDialog()

If OpenFileDialog1.FileName <> "" Then

Dim Filestream As FileStream = New FileStream(OpenFileDialog1.FileName,
FileMode.Open)

Dim binReader As New Bitmap(Filestream)

PictureBox1.Image = binReader

Filestream.Close()

Else : Return

End IfI

End Sub

' Can I also use the Filestream-object for saving pictures. Thank you for
your help.
 
But in your example, the image is already on disc....

What do you really want to do??

You can save any image with the Save("filename", ImageFormat.whatever);
method.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top