• 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

    • Neat and welcome functionality...
    • Hey, some don't give a damn about STDs and gain pleasure from living animalistic lifestyles. Different strokes for different folks...
    • Halo Studios is teasing a big reveal for the series this October by Pulasthi Ariyasinghe Halo Studios, formerly 343 Industries, is preparing to reveal what it has been working on since the release of Halo Infinite. Other than providing support for existing Halo works, like Master Chief Collection and Infinite, the Xbox first-party studio has been rather quiet about its next releases since 2021. In its monthly blog post on Halo Waypoint, the developer had a special section regarding its future plans and dropped a pretty heavy teaser about an October announcement. Just like at the 2024 Halo World Championship, this year, the studio is planning another special announcement for fans. "Over the past few weeks, there’s been a fair amount of speculation about when and where more details might emerge about any of the multiple projects Halo Studios is actively working on," says the studio. "We don’t usually comment on such matters, but this time we want to enter the chat and share a little more perspective for Halo fans who might be on the fence about whether to attend this year’s event." In October of last year, 343 Industries, the development team that has been making games in the series since Halo 4 in 2012, went through a major rebranding to become Halo Studios. While no exact details were given, alongside a teaser video, the studio said then that multiple projects were currently in development but are years away from being released. It also revealed last year that the Slipspace Engine it developed for Halo Infinite is also being left behind in favor of Unreal Engine 5. "Speculation is always fun, but if you want the official scoop on what Halo Studios has been working on, you won’t want to miss this year’s Halo World Championship," added the studio. "We really hope you’ll join us in Seattle this October!" The 2025 Halo World Championship is slated to take place on October 24 in Seattle. Halo will be turning 25 years old in 2026, and it's likely that a new game or a remaster project will be revealed during this event.
    • I enjoy using Discover Weekly. I have found new music using it. Just sometimes it goes off the rails and doesn't remember I don't like rap. I'm not sure this update is anything helpful, but I guess I'll try it if it comes to free accounts.
  • Recent Achievements

    • Week One Done
      dennis Nebeker earned a badge
      Week One Done
    • One Year In
      timothytoots earned a badge
      One Year In
    • One Month Later
      CHUNWEI earned a badge
      One Month Later
    • Week One Done
      TIGOSS earned a badge
      Week One Done
    • First Post
      henryj earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      464
    2. 2
      +FloatingFatMan
      193
    3. 3
      ATLien_0
      165
    4. 4
      Xenon
      78
    5. 5
      wakjak
      72
  • Tell a friend

    Love Neowin? Tell a friend!