Xamarin.Forms.Extensions.Svg
1.0.0
See the version list below for details.
dotnet add package Xamarin.Forms.Extensions.Svg --version 1.0.0
NuGet\Install-Package Xamarin.Forms.Extensions.Svg -Version 1.0.0
<PackageReference Include="Xamarin.Forms.Extensions.Svg" Version="1.0.0" />
paket add Xamarin.Forms.Extensions.Svg --version 1.0.0
#r "nuget: Xamarin.Forms.Extensions.Svg, 1.0.0"
// Install Xamarin.Forms.Extensions.Svg as a Cake Addin #addin nuget:?package=Xamarin.Forms.Extensions.Svg&version=1.0.0 // Install Xamarin.Forms.Extensions.Svg as a Cake Tool #tool nuget:?package=Xamarin.Forms.Extensions.Svg&version=1.0.0
Xamarin.Forms.Extensions.Svg
SkiaSharp based component to load SVG images from the Embedded Resources of an Xamarin.Forms Application.
Status
[](https://www.nuget.org/packages/Xamarin.Forms.Extensions.Svg/
Setup
Install the library via Nuget, add the latest version of SkiaSharp to your Apps Shared and Platform Projects and add the following line to your Apps App.xaml.cs
:
public App()
{
InitializeComponent();
// ...
Xamarin.Forms.Extensions.Svg.SvgImage.RegisterAssembly();
// ...
MainPage = new MainPage();
}
Usage
First add your SVG images to your Shared Project as EmbeddedResource.
Afterwards you can use the SvgImage View in your App:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:svg="clr-namespace:Xamarin.Forms.Extensions.Svg;assembly=XamExtensionsSvg"
x:Class="SVGSample.MainPage">
<svg:SvgImage Source="tiger.svg" WidthRequest="100" HeightRequest="100" />
</ContentPage>
If you want to change the SVGs color you can use the TintColor
property:
<svg:SvgImage Source="colours.svg" WidthRequest="20" HeightRequest="20" TintColor="#fcd303" />
Sample
This project contains a Sample Application in the folder Sample
.
Acknowledgements
This work is based on an article and code sample by
@AlexPshul http://www.pshul.com/2018/01/25/xamarin-forms-using-svg-images-with-skiasharp/
and some inspiration and sample assets from muak/SvgImageSource by @muak.
License
Author(s)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid is compatible. |
MonoMac | monomac was computed. |
MonoTouch | monotouch is compatible. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- SkiaSharp (>= 2.80.3)
- SkiaSharp.Extended (>= 1.60.0)
- SkiaSharp.Svg (>= 1.60.0)
- SkiaSharp.Views.Forms (>= 2.80.3)
- Xamarin.Forms (>= 5.0.0.2196)
-
MonoAndroid 0.0
- SkiaSharp (>= 2.80.3)
- Xamarin.Forms (>= 5.0.0.2196)
-
MonoTouch 0.0
- SkiaSharp (>= 2.80.3)
- Xamarin.Forms (>= 5.0.0.2196)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.6 | 1,304 | 2/28/2023 |
1.0.6-pre001 | 564 | 2/28/2023 |
1.0.5 | 744 | 2/16/2023 |
1.0.5-pre001 | 632 | 2/16/2023 |
1.0.4 | 1,344 | 10/2/2022 |
1.0.3 | 903 | 10/2/2022 |
1.0.2 | 3,227 | 11/10/2021 |
1.0.1 | 782 | 11/9/2021 |
1.0.0 | 794 | 11/9/2021 |
1.0.0-pre008 | 667 | 11/9/2021 |