Giter Site home page Giter Site logo

Comments (7)

thomaslevesque avatar thomaslevesque commented on May 11, 2024 1

Hi,

Thanks for reporting the issue. I'll look into it as soon as I can.

from wpfanimatedgif.

mivor avatar mivor commented on May 11, 2024

Hi,

Any updates on this? I'm also having crashes because of the GDI leak.

from wpfanimatedgif.

thomaslevesque avatar thomaslevesque commented on May 11, 2024

Hi,

Sorry @LordRiffRaff for taking so long before getting back to you, and thanks @mivor for reminding me ;)

The WriteableBitmap trick does seem to keep the GDI handle count at more reasonable level. I'll publish a release with this fix shortly.
I'm wary about running a full GC every time an animation is loaded, though... it can have a pretty heavy impact on application performance, and I don't want to penalize the vast majority of users who are not affected by the problem by forcing a full GC on them.

from wpfanimatedgif.

LordRiffRaff avatar LordRiffRaff commented on May 11, 2024

Yeah, the GC hit can be jarring. In my use case I didn't care as it was for a kiosk, so once the app has started up you no longer care. The only problem though is that without it, it'll crash randomly. I'm not aware of a way to force the finalizer of the RenderTargetBitmap otherwise. https://stackoverflow.com/questions/13954829/gc-collect-and-finalize

Maybe an app config settings?

Then again, it may be only me and @mivor who've ended up with projects with gifs with tens of thousands of frames.

from wpfanimatedgif.

thomaslevesque avatar thomaslevesque commented on May 11, 2024

gifs with tens of thousands of frames.

Really?! 😲
OK, this might be a dumb question, but why not use a video instead? The GIF format was never intended for very long animations...

Anyway, I just released 1.4.15, which includes the WriteableBitmap fix.

from wpfanimatedgif.

mivor avatar mivor commented on May 11, 2024

Thanks for the quick fix. I will check tomorrow how it performs.
In my case the gif is definetly smaller.
I have the same gif animated in 6-10 places in one screen, for a loading animation.

from wpfanimatedgif.

LordRiffRaff avatar LordRiffRaff commented on May 11, 2024

03_cheesepyramid
05_picnicbasket

Transparency, and the animation house exported them all as gifs. In the end I wrote a pixel shader to do transparent chromakey video for the large animations (i.e the ones that were 200x200 pixels).

from wpfanimatedgif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.