SvgImageLoader.Android.Glide
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SvgImageLoader.Android.Glide --version 1.0.0
NuGet\Install-Package SvgImageLoader.Android.Glide -Version 1.0.0
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="SvgImageLoader.Android.Glide" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SvgImageLoader.Android.Glide" Version="1.0.0" />
<PackageReference Include="SvgImageLoader.Android.Glide" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SvgImageLoader.Android.Glide --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SvgImageLoader.Android.Glide, 1.0.0"
#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.
#:package SvgImageLoader.Android.Glide@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SvgImageLoader.Android.Glide&version=1.0.0
#tool nuget:?package=SvgImageLoader.Android.Glide&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SVGImageLoader
SVGImageLoader is a .NET Android library for loading SVG images from a URL into an ImageView using Glide and SkiaSharp.
Features
- Load SVG images from remote URLs directly into Android
ImageViewwidgets - Uses Glide for efficient image loading and caching
- Decodes SVGs to Android Bitmaps using SkiaSharp
- Customizable placeholder and error images
- Preserves aspect ratio of SVGs
Getting Started
- Add a reference to the
SvgImageLoader.Androidproject in your .NET Android solution. - Use the static
SvgLoaderclass to load SVG images into yourImageView.
Basic Usage
using SvgImageLoader;
// Load SVG from URL
SvgLoader.LoadSvg(myImageView, "https://example.com/image.svg");
// With placeholder and error images
SvgLoader.LoadSvg(myImageView, "https://example.com/image.svg", Resource.Drawable.placeholder, Resource.Drawable.error);
How it Works
- Glide fetches the SVG file from the URL
- A custom Glide target and request listener handle SVG decoding and error logging
- SkiaSharp decodes the SVG stream to a Bitmap, which is set on the
ImageView
Project Structure
SvgLoader.cs: Main API for loading SVGsDecoders/SkiaSvgDecoder.cs: Decodes SVG files to Bitmaps using SkiaSharpListeners/SvgRequestListener.cs: Handles Glide request events and loggingCustomTargets/SvgGlideTarget.cs: Custom Glide target for SVG rendering
License
See LICENSE for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0-android36.0
- SkiaSharp (>= 3.119.2)
- Xamarin.Android.Glide (>= 5.0.5.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.