Quote Originally Posted by boops boops View Post
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:

Name:  PV_FileUsed3.jpg
Views: 3808
Size:  15.7 KB