Skip to content

IIconCache

IIconCache is an important aspect of Aurora interfaces as it allows you to use SVGs as image resources within Xamarin.Forms. It provides the additional abilities of being able to recolor and resize the images.

Methods

Image IconFromSvg(string svgName, double squareSize = 22d, string additionalCacheKey = "", Color colorOverride = default(Color));

Fetches an SVG icon by name.

returns: The icon as an Image.

svgName: The name of the SVG.

squareSize: The square size of the icon.

additionalCacheKey: Allows for setting an addiitonal cache key.

colorOverride: Allows for setting the color of the icon.


Image IconFromSvg(string svgName, Size size, string additionalCacheKey = "", Color colorOverride = default(Color));

Fetches an SVG icon by name.

returns: The icon as an Image.

svgName: The name of the SVG.

size: A Xamarin.Forms.Size representing the desired size of the icon.

additionalCacheKey: Allows for setting an addiitonal cache key.

colorOverride: Allows for setting the color of the icon.


ImageSource SourceFromSvg(string svgName, double squareSize = 22d, string additionalCacheKey = "", Color colorOverride = default(Color));

Fetches an SVG source by name.

returns: The icon as an ImageSource.

svgName: The name of the SVG.

squareSize: The square size of the icon.

additionalCacheKey: Allows for setting an addiitonal cache key.

colorOverride: Allows for setting the color of the icon.


ImageSource SourceFromSvg(string svgName, Size size, string additionalCacheKey = "", Color colorOverride = default(Color));

Fetches an SVG icon by name.

returns: The icon as an ImageSource.

svgName: The name of the SVG.

size: A Xamarin.Forms.Size representing the desired size of the icon.

additionalCacheKey: Allows for setting an addiitonal cache key.

colorOverride: Allows for setting the color of the icon.


FileImageSource FileImageSourceFromSvg(string svgName, double squareSize = 22d, string additionalCacheKey = "", Color colorOverride = default(Color));

Fetches an SVG file image source by name.

returns: The icon as a FileImageSource.

svgName: The name of the SVG.

squareSize: The square size of the icon.

additionalCacheKey: Allows for setting an addiitonal cache key.

colorOverride: Allows for setting the color of the icon.


FileImageSource FileImageSourceFromSvg(string svgName, Size size, string additionalCacheKey = "", Color colorOverride = default(Color));

Fetches an SVG icon by name.

returns: The icon as a FileImageSource.

svgName: The name of the SVG.

size: A Xamarin.Forms.Size representing the desired size of the icon.

additionalCacheKey: Allows for setting an addiitonal cache key.

colorOverride: Allows for setting the color of the icon.


Image SourceFromRawSvg(string svgName, Size size);

Sources from raw svg

returns: The from raw svg.

svgName: The name of the SVG.

size: A Xamarin.Forms.Size representing the desired size of the icon.


void LoadAssembly(Assembly assembly);

Loads the assembly.


Task<SKBitmap> SKBitmapFromSource(ImageSource imageSource);

SKBs the bitmap from source.

returns: The bitmap from source.

imageSource: Image source.


Task<Byte[]> ByteArrayFromSource(ImageSource imageSource);

Byte array the bitmap from source.

returns: The byte array from source.

imageSource: Image source.


Task<Stream> StreamFromSource(ImageSource imageSource);

Stream the bitmap from source.

returns: The stream from source.

imageSource: Image source.


void ClearCache();

Clears the cache.