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:
But it doesn't work if you comment out the Dispose statement (or Using ... End Using). I wonder why...?Code:Dim img As Image = Image.FromFile(filename) PictureBox1.Image = New Bitmap(img) img.Dispose() 'and now this works! IO.File.Delete(filename)
BB




Reply With Quote
