Xamarin.Forms.Extensions.Svg 1.0.5-pre001

This is a prerelease version of Xamarin.Forms.Extensions.Svg.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Xamarin.Forms.Extensions.Svg --version 1.0.5-pre001                
NuGet\Install-Package Xamarin.Forms.Extensions.Svg -Version 1.0.5-pre001                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xamarin.Forms.Extensions.Svg" Version="1.0.5-pre001" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xamarin.Forms.Extensions.Svg --version 1.0.5-pre001                
#r "nuget: Xamarin.Forms.Extensions.Svg, 1.0.5-pre001"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Xamarin.Forms.Extensions.Svg as a Cake Addin
#addin nuget:?package=Xamarin.Forms.Extensions.Svg&version=1.0.5-pre001&prerelease

// Install Xamarin.Forms.Extensions.Svg as a Cake Tool
#tool nuget:?package=Xamarin.Forms.Extensions.Svg&version=1.0.5-pre001&prerelease                

Xamarin.Forms.Extensions.Svg

SkiaSharp based component to load SVG images from the Embedded Resources of an Xamarin.Forms Application.

Status

build

NuGet

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

MIT

Author(s)

@bnoffer

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 665 11/9/2021