Audax321
Well-known member
- Joined
- May 4, 2002
- Messages
- 90
Hello,
Im writing a program that gets the path to an image and sets it to an image variable:
Then, I resize the picture and save it as another filename...
And, finally the problem occurs:
The program will not let me delete the original file because it is being used by another process (which is my program). I found out it was my program because if I delete the image before any of the above code runs, the file is deleted fine.
How can I do this in a way that will let me delete the file????
Im writing a program that gets the path to an image and sets it to an image variable:
Code:
Dim file as String
Dim CurrentImage as Image
file = "C:\wallpaper.bmp"
CurrentImage = Image.FromFile(file)
Then, I resize the picture and save it as another filename...
Code:
CurrentImage = CurrentImage.GetThumbnailImage(NewSize.Width, NewSize.Height, Nothing, Nothing)
CurrentImage.Save(NewPath & "\" & "newname.bmp")
And, finally the problem occurs:
Code:
Kill(file)
The program will not let me delete the original file because it is being used by another process (which is my program). I found out it was my program because if I delete the image before any of the above code runs, the file is deleted fine.
How can I do this in a way that will let me delete the file????