mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
dont create a bitmapimage for gifs
This commit is contained in:
parent
23d8bb1aaa
commit
605db3cc0f
@ -523,21 +523,25 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
|
||||
if (result == null)
|
||||
throw new Exception("Image Source uri is null");
|
||||
|
||||
BitmapImage bitmapImage;
|
||||
try
|
||||
{
|
||||
bitmapImage = new BitmapImage(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"Image Failed to create BitmapImage: {ex.Message}", ex);
|
||||
}
|
||||
|
||||
bool isAnimated = ParseXmlAttribute<bool>(xmlElement, "IsAnimated", false);
|
||||
if (!isAnimated)
|
||||
{
|
||||
BitmapImage bitmapImage;
|
||||
try
|
||||
{
|
||||
bitmapImage = new BitmapImage(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"Image Failed to create BitmapImage: {ex.Message}", ex);
|
||||
}
|
||||
|
||||
image.Source = bitmapImage;
|
||||
else // we create the bitmapimage to check if the gif is valid
|
||||
}
|
||||
else
|
||||
{
|
||||
XamlAnimatedGif.AnimationBehavior.SetSourceUri(image, result);
|
||||
}
|
||||
}
|
||||
|
||||
ApplyTransformations_UIElement(image, xmlElement);
|
||||
|
Loading…
Reference in New Issue
Block a user