I have a quick question. I am importing a picture to use in a picturebox with the following code.
Then, later in the program, I want to replace the file pic.jpg with another file, but I can not because the program is still using pic.jpg. Can someone tell me how to 'release' this file once I have loaded it and set the picturebox?
Thanks,
Chris
VB.NET:
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] im [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Image = Bitmap.FromFile([/SIZE][SIZE=2][COLOR=#800000]"pic.jpg"[/COLOR][/SIZE][SIZE=2])
PictureBox.Image = im
[/SIZE]
Then, later in the program, I want to replace the file pic.jpg with another file, but I can not because the program is still using pic.jpg. Can someone tell me how to 'release' this file once I have loaded it and set the picturebox?
Thanks,
Chris