Animation
-
Hi I need to put a animation into my app, but I was wonderind what it's better use single frames and swap them with a timer or use a gif or avi directly (it's possible with .NET?) Thanks ---- hxxbin
Depends on the quality of the animation and whether or not you want to require additional dependencies. You could use a
PictureBox
to show an animated GIF, but GIFs only display 256 colors and don't support an alpha channel. If you want to display an AVI or other video file, you could host the Windows Media Player control and hide its UI. Windows also contains an older version of this control but you may have problems finding information about it. Another option is to use DirectX, for which there is now a managed runtime (aptly named Managed DirectX (9.0b)). Finally, you could always use a timer and loop frames (basically what a GIF does). You can use a higher quality image this way, but your FPS are limited by the relatively low resolution of the timer classes in the .NET Framework. Again, it all depends on what you want and how many dependencies you're willing to require.Microsoft MVP, Visual C# My Articles
-
Depends on the quality of the animation and whether or not you want to require additional dependencies. You could use a
PictureBox
to show an animated GIF, but GIFs only display 256 colors and don't support an alpha channel. If you want to display an AVI or other video file, you could host the Windows Media Player control and hide its UI. Windows also contains an older version of this control but you may have problems finding information about it. Another option is to use DirectX, for which there is now a managed runtime (aptly named Managed DirectX (9.0b)). Finally, you could always use a timer and loop frames (basically what a GIF does). You can use a higher quality image this way, but your FPS are limited by the relatively low resolution of the timer classes in the .NET Framework. Again, it all depends on what you want and how many dependencies you're willing to require.Microsoft MVP, Visual C# My Articles
-
The animation is little, but needs 24-bits color and alpha. I think I'll use the timer cuz I don't know how to use DirectX, I imagine that with DirectDraw2D I could do it, but I don't know how, you know some good info about??. Thanks ---- hxxbin
http://msdn.microsoft.com/directx[^]
Microsoft MVP, Visual C# My Articles