File in use with stream...

lidds

Well-known member
Joined
Oct 19, 2004
Messages
122
Programming Experience
Beginner
I am writing a image file to a stream and then add this to a picturebox using the following code:

VB.NET:
' Converts comment image in zip file to bmp
        Dim bmp As New Bitmap(New System.IO.FileStream("C:\Orig.bmp", FileMode.Open, FileAccess.Read))
Me.pictureBox.Image = bmp

The problem is that when I try to delete the file it gives me an error that the file is still in use. What I need to know is how I can release the image file.

Thanks in advance

Simon
 
Back
Top