Orumcek
08-02-2006, 08:41 AM
Hi All,
I have 4 icon on my project and i change icon every 150 milisecond and create animation. I want icons embeded. There fore i use image list and store they.
So, after a short while i get "A general error occurred in GDI+". I think, handle needs to be released to free memory. But how can i do ?
Thank you.
Regards.
My Animation Sub:
Private Sub animTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles animTimer.Tick
If ico < 3 Then
ico = ico + 1
Else
ico = 0
End If
'Change Icon
NotifyIcon1.Icon = System.Drawing.Icon.FromHandle(CType(imgList.Images.Item(ico), System.Drawing.Bitmap).GetHicon())
End Sub
I have 4 icon on my project and i change icon every 150 milisecond and create animation. I want icons embeded. There fore i use image list and store they.
So, after a short while i get "A general error occurred in GDI+". I think, handle needs to be released to free memory. But how can i do ?
Thank you.
Regards.
My Animation Sub:
Private Sub animTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles animTimer.Tick
If ico < 3 Then
ico = ico + 1
Else
ico = 0
End If
'Change Icon
NotifyIcon1.Icon = System.Drawing.Icon.FromHandle(CType(imgList.Images.Item(ico), System.Drawing.Bitmap).GetHicon())
End Sub