C
copyco
I've got an application where I have an animated image in a picturebox.
A timer event changes the image by assigning an image from an
imagelist to it. I've found that the code for this is causing the
application to use more and more memory until it craps out. If I
comment the code out, it's fine. Can anyone tell me if there is a way I
can manage the memory better? Is there better code for this or
something? Why is it using up memory? Any help is appreciated. The
code below is what I have within my timer event which fires once per
second...
imageIndex += 1
If imageIndex > 11 Then
imageIndex = 0
End If
If cmiShowAnimation.Checked Then
pboAnimation.Image = ilsAnimation.Images(imageIndex)
End If
A timer event changes the image by assigning an image from an
imagelist to it. I've found that the code for this is causing the
application to use more and more memory until it craps out. If I
comment the code out, it's fine. Can anyone tell me if there is a way I
can manage the memory better? Is there better code for this or
something? Why is it using up memory? Any help is appreciated. The
code below is what I have within my timer event which fires once per
second...
imageIndex += 1
If imageIndex > 11 Then
imageIndex = 0
End If
If cmiShowAnimation.Checked Then
pboAnimation.Image = ilsAnimation.Images(imageIndex)
End If