How do I create a Stream object from a Bitmap

B

Bill Fuller

I have a need to write a Bitmap to a Stream, but get an error message on all
my attempts. I am doing something like the following:

Stream _appImage;

public frmCustomerFeedback(Bitmap bm)
{
InitializeComponent();

bm.Save(_appImage, System.Drawing.Imaging.ImageFormat.Jpeg); <== this
fails
//bm.Save("testimg.jpg", System.Drawing.Imaging.ImageFormat.Jpeg); <==
this works
ugPictureBox.Image = bm;
}

Any suggestions?
 
B

Bill Fuller

Never mind... found my problem.

MemoryStream _appImage = new MemoryStream();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top