Table of Contents

Method GetSvgImageAndSize

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

GetSvgImageAndSize(SvgImage?, KnownButton?, AbstractControl, int?)

Retrieves an SVG image and its associated size based on the provided parameters.

public static (SvgImage? SvgImage, int SvgSize) GetSvgImageAndSize(SvgImage? svg, KnownButton? btn, AbstractControl control, int? size)

Parameters

svg SvgImage

An optional SvgImage instance. If null, the method attempts to retrieve an image based on the btn parameter.

btn KnownButton?

An optional KnownButton value used to retrieve a default SVG image if svg is null.

control AbstractControl

The AbstractControl instance used to determine the default image size if size is not provided.

size int?

An optional size, in pixels, for the SVG image. If null, the default size is determined based on the control parameter.

Returns

(SvgImage SvgImage, int SvgSize)

A tuple containing the resulting SvgImage (or null if no image is available) and the size of the image in pixels.

Remarks

If both svg and btn are null, the method returns null for the SVG image and the default size determined by the control parameter.