Table of Contents

Method CreateImageElement

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

CreateImageElement(AbstractControl?, SvgImage, int?, Color?)

Creates a Graphics.DrawElementParams object for rendering an image element based on the specified SVG image, size, and optional color.

public static Graphics.DrawElementParams CreateImageElement(AbstractControl? control, SvgImage svg, int? size, Color? color = null)

Parameters

control AbstractControl

The control associated with the image element. This is used to determine default size and color if not explicitly provided. Can be null.

svg SvgImage

The SvgImage to be rendered as the image element.

size int?

The size of the image in pixels. If null, a default size is determined based on the control.

color Color

The color to apply to the SVG image. If null, a default color is determined based on the control.

Returns

Graphics.DrawElementParams

A Graphics.DrawElementParams object representing the configured image element.

Remarks

If both size and color are null, the method uses default values derived from the provided control. The resulting image element is created with the specified or default size and color.

CreateImageElement(Image?)

Creates a new image element for rendering using the specified image.

public static Graphics.DrawElementParams CreateImageElement(Image? image)

Parameters

image Image

The image to be used for the element. Cannot be null.

Returns

Graphics.DrawElementParams

A Graphics.DrawElementParams object configured to render the specified image.

CreateImageElement(ref DrawLabelParams, Image?)

Creates an image element based on the specified drawing parameters.

public static Graphics.DrawElementParams CreateImageElement(ref Graphics.DrawLabelParams prm, Image? imageOverride = null)

Parameters

prm Graphics.DrawLabelParams

A reference to the Graphics.DrawLabelParams structure containing the parameters for drawing the image, including the image source and alignment settings.

imageOverride Image

The Image to use as the image for the element, overriding any image specified in prm.

Returns

Graphics.DrawElementParams

An Graphics.DrawElementParams object representing the image element to be drawn, or null if the Image property is null.

Remarks

The returned Graphics.DrawElementParams object includes the size calculation and drawing logic for the image, as well as alignment settings derived from the provided parameters.