Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Animation

Animation

Scheduled Pinned Locked Moved C#
csharpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hxxbin
    wrote on last edited by
    #1

    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

    H 1 Reply Last reply
    0
    • H hxxbin

      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

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      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

      H 1 Reply Last reply
      0
      • H Heath Stewart

        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

        H Offline
        H Offline
        hxxbin
        wrote on last edited by
        #3

        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

        H 1 Reply Last reply
        0
        • H hxxbin

          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

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          http://msdn.microsoft.com/directx[^]

          Microsoft MVP, Visual C# My Articles

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups