luberda-molinet / FFImageLoading

Image loading, caching & transforming library for Xamarin and Windows
MIT License
1.42k stars 377 forks source link

Use Svg as imagesource for Image #1437

Open michelevirgilio opened 4 years ago

michelevirgilio commented 4 years ago

Hi, would it be possible to use SvgCachedImage as ImageSource for a regular Image object? Something like this

    <Image Source="{extensions:ImageResourceExtension Source=resource://Test.Resources.orders.svg}"  />
public object ProvideValue(IServiceProvider serviceProvider)
{
      ......
      return SvgImageSource.FromResource(Source, Assembly);
      ......
}

Thanks

renzska commented 4 years ago

I'm also looking to do the same thing. I'll let you know if I find anything.

pierregarcia commented 4 years ago

I'm also looking for the same thing. Did you find a solution ?

NightOwlCoder commented 4 years ago

I've been using this:

IconImageSource = SvgImageSource.FromFile("resource://ICBolt.UI.Resources.logout.svg?assembly=ICBolt.UI");

EmilAlipiev commented 4 years ago

I've been using this:

IconImageSource = SvgImageSource.FromFile("resource://ICBolt.UI.Resources.logout.svg?assembly=ICBolt.UI");

Does that work? even it works, i think there is no equivalent for this in xaml yet

Kapusch commented 4 years ago

@EmilAlipiev I think you could apply this in Xaml if you implement IValueConverter, or even IMarkupExtension.