XamlAnimatedGif/WpfAnimatedGif

Not working with DrawingImage

TimurVa opened this issue · 5 comments

I have an issue with DrawingImage as AnimatedSource. I noticed that in source code the check is only made for BitmapSource if it is not a '.gif'. So is there any possibility to improve this functionality, so we can use not only BitmapSource as AnimatedSource but any ImageSource if we don't wont to use gif animation behaviour? Or maybe should I do the Pull request for this feature?

Hi @TimurVa,

Thanks for your interest!

Looking at the code again, it looks like it should work already... The InitAnimationOrImage just sets the imageControl.Source if it's not an animated GIF, so I'm not sure why it doesn't work for you. Let me do a few tests, I'll get back to you shortly.

Thanks for so quick response! In case it may help my Drawing images looks like this. I'm compiling them so they are existing in Resource dictionaries and I get them like Application.TryFindResource("TextAlignLeftImage"). Also I'm generating them via this project https://github.com/BerndK/SvgToXaml:

<DrawingImage x:Key="TextAlignLeftImage">
    <DrawingImage.Drawing>
        <DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
            <GeometryDrawing Brush="#FFC3C3C3" Geometry="F1 M24,24z M0,0z M15,19L3,19 3,17 15,17 15,19z M21,15L3,15 
                  3,13 21,13 21,15z M15,11L3,11 3,9 15,9 15,11z M21,7L3,7 3,5 21,5 21,7z" />
        </DrawingGroup>
    </DrawingImage.Drawing>
</DrawingImage>

OK, I see the problem. I'll have a fix shortly

@thomaslevesque Thanks for fix!

The fix is deployed to NuGet (v2.0.1, should appear in a few minutes after it's validated and indexed)