Table of Contents

Method LoadSvgFromResource

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

LoadSvgFromResource(Assembly, TKey, bool)

Loads an SVG image from an embedded resource within the specified assembly.

public virtual bool LoadSvgFromResource(Assembly assembly, TKey imageKey, bool isSmallImage = true)

Parameters

assembly Assembly

The assembly containing the embedded resource.

imageKey TKey

The key used to identify the image.

isSmallImage bool

A value indicating whether to load the small version of the image. If true, the method attempts to load the small image; otherwise, the regular image.

Returns

bool

true if the SVG image was successfully loaded and set; otherwise, false.

Remarks

The method resolves the resource path based on the provided imageKey and isSmallImage flag. If the resource path is null or the resource is not an SVG file, the method returns false.

LoadSvgFromResource(Assembly, bool)

Loads SVG images from the specified assembly and processes them based on the provided size option.

public void LoadSvgFromResource(Assembly assembly, bool isSmallImage = true)

Parameters

assembly Assembly

The assembly containing the embedded SVG resources to load.

isSmallImage bool

A boolean value indicating whether to load the SVG images as small-sized images. true to load small images; otherwise, false.

Remarks

This method iterates through all keys in the internal collection of SVG images and loads the corresponding SVG resources from the specified assembly. The size of the images is determined by the isSmallImage parameter.