Hi,
I'm having a problem overwriting a previously downloaded image after I disposed the image. What I want to do is download an image and show it on the main form more than one time. But the second time I download the image and want to overwrite the old one I get an error saying:
"The process cannot access the file '(downloaded file)' because it is being used by another process."
It is obviously still being used by the application and can therefore not be overwritten. But I did dispose the image. Is there a way to force the application to release the image so it can be overwritten?
A workaround would be to give the image another name each time it is being downloaded. But that way I would end up with a directory full of unused images.
To clarify my problem I wrote a little app that I will attach.
Regards,
Joost
I'm having a problem overwriting a previously downloaded image after I disposed the image. What I want to do is download an image and show it on the main form more than one time. But the second time I download the image and want to overwrite the old one I get an error saying:
"The process cannot access the file '(downloaded file)' because it is being used by another process."
It is obviously still being used by the application and can therefore not be overwritten. But I did dispose the image. Is there a way to force the application to release the image so it can be overwritten?
A workaround would be to give the image another name each time it is being downloaded. But that way I would end up with a directory full of unused images.
To clarify my problem I wrote a little app that I will attach.
Regards,
Joost
Attachments
Last edited: