"Penk" <el*****@hotmail.com> schrieb:
I need a form to delete an image that is shown in a control, to replace
with
another image.
I tried changing the archive that is showing the control, closing the form
and then deleting the old image, but there's an error
because the system says that the archive is in use.
I need to replace this image, someone knows a way to close conections to
the
archive, or something like this?
\\\
Dim OriginalImage As New Bitmap("C:\WINDOWS\Angler.bmp")
Dim Image As New Bitmap(OriginalImage)
OriginalImage.Dispose()
..
..
..
Image.Dispose()
///
- or -
\\\
Dim ImageFile As New FileStream("C:\WINDOWS\Angler.bmp", FileMode.Open)
Dim Reader As New BinaryReader(ImageFile)
Dim ImageStream As New
MemoryStream(Reader.ReadBytes(CInt(ImageFile.Lengt h)))
Reader.Close()
Dim Image As Image = Image.FromStream(ImageStream)
..
..
..
Image.Dispose()
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>