Table of Contents

Method SetLabelImage

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

SetLabelImage(SvgImage?, KnownButton?, HVAlignment?, CoordAndUnit?)

Sets the label's image using the specified SVG image, button type, alignment, and size.

public virtual void SetLabelImage(SvgImage? svg, KnownButton? btn = null, HVAlignment? align = null, CoordAndUnit? size = null)

Parameters

svg SvgImage

The SVG image to be displayed on the label. Can be null to remove the current image.

btn KnownButton?

The button type that determines the style or context of the image. Can be null for default behavior.

align HVAlignment?

The horizontal and vertical alignment of the image relative to the label. Defaults to null, which uses the label's default alignment.

size CoordAndUnit?

The size of the image in pixels. Can be null to use the default size.

Remarks

This method updates the label's image and alignment properties. The image is aligned to the right horizontally and centered vertically by default.

SetLabelImage(KnownButtonImage)

Sets the label image for a button using the specified predefined image, button type, alignment, and size.

public virtual void SetLabelImage(KnownButtonImage knownButtonAndImage)

Parameters

knownButtonAndImage KnownButtonImage

An object containing the image parameters.

Remarks

This method simplifies the process of setting a label image by encapsulating the required parameters in a single object.