|
-
Feb 21st, 2020, 03:44 PM
#5
Thread Starter
Junior Member
Re: Deletion of current image impossible as it is being used by another process
 Originally Posted by boops boops
It's amazing how tenacious System.Drawing is in keeping its grubby grip on the image. After some experimentation, however, I found a more concise way to do it:
Code:
Dim img As Image = Image.FromFile(filename)
PictureBox1.Image = New Bitmap(img)
img.Dispose()
'and now this works!
IO.File.Delete(filename)
But it doesn't work if you comment out the Dispose statement (or Using ... End Using). I wonder why...?
BB
Hi BB,
Regretably not yet:

Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|