• 0

[C#] Animated gif and cpu usage


Question

8 answers to this question

Recommended Posts

  • 0

Oh,your'e right :rolleyes: .I'm using c# (I'm a beginner so... :) ) and I'm doing the animation by changing the gif's frames and drawing them(sorry but I don't really know how to explain this) this way:

Gifs.SelectActiveFrame(dimension,i); 
	g.DrawImage(Gifs,x, 1,width, height);

The "i" is the number of the frame which I change each time to make the animation.The problem is that drawing the image each time causes a rise in the CPU usage.Is there any way to reduce it?

Edited by yyy
  • 0

To accomplish this, the best way (aside from using ImageAnimator) would be to load all of the frames at once, each into its own variable, and then use a PictureBox to cycle through the images. Set the PictureBox's Image property to the image representing the current frame each time it switches.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

  • Recent Achievements

    • First Post
      Celilo earned a badge
      First Post
    • One Year In
      K.I.S.S. earned a badge
      One Year In
    • Week One Done
      solidox earned a badge
      Week One Done
    • Dedicated
      solidox earned a badge
      Dedicated
    • Week One Done
      Devesh Beri earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      441
    2. 2
      ATLien_0
      165
    3. 3
      +FloatingFatMan
      152
    4. 4
      Nick H.
      66
    5. 5
      +thexfile
      62
  • Tell a friend

    Love Neowin? Tell a friend!