• 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.