Removing Images from Memory?
'stores images to display in the background
Private backgroundPicture As Image
Private Sub backgroundChangeTimerTick(ByVal sender As Object, ByVal e As EventArgs) Handles backgroundChangeTimer.Tick
' Change the background image to the next image.
Randomize()
rand = Rnd() * 343 + 1
address = "E:\My Folders\Sean\My Pictures\Screen Saver\" & "screensaver (" & rand & ").JPG"
backgroundPicture = Image.FromFile(address)
Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
' Draw the current background image stretched to fill the full screen
e.Graphics.DrawImage(backgroundPicture, 0, 0, Size.Width, Size.Height)
End Sub
I thought that the image would be overwritten in memory since it is being stored as backgroundPicture. What am I doing wrong?

