I know how I do to place a icon in the systray. But what the best method to perform systray icon animation? animated gifs? timers?
Preferentially using C# and/or WPF. Thanks!
I know how I do to place a icon in the systray. But what the best method to perform systray icon animation? animated gifs? timers?
Preferentially using C# and/or WPF. Thanks!
I think the best way to do this is to have multiple small icons which you can continue to change the systray object to the new picture based on the speed and the time.
With a timer, you could do something like
public void timer1_Tick(object sender, EventArgs e)
{
int framesPerSecond = 5;
int index = (Environment.TickCount * framesPerSecond / 1000) %
animationImgList.Images.Count;
IntPtr hIcon = ((Bitmap)(imgList.Images[index])).GetHicon();
notifyIcon.Icon = Icon.FromHandle(hIcon);
}
Of course, you'd want the ticks to happen fast enough for your chosen framesPerSecond
I don't know which language you are writing in, but here is a C++ example: http://www.codeproject.com/KB/shell/ss_trayicon.aspx
It's an oldy, but a goody: http://blogs.msdn.com/abhinaba/archive/2005/09/12/animation-and-text-in-system-tray-using-c.aspx