Skip to main content

RenderOptions Struct

Definition

Namespace:Avalonia.Media
Assembly:Avalonia.Base
Package:Avalonia

Provides a set of options that control rendering behavior for visuals, including text rendering, bitmap interpolation, edge rendering, blending, and opacity handling.

public struct RenderOptions

Inheritance: ValueType -> RenderOptions

Implements: IEquatable<RenderOptions>

Remarks

Use this structure to specify rendering preferences for visual elements. Each property corresponds to a specific aspect of rendering, allowing fine-grained control over how content is displayed. These options can be applied to visuals to influence quality, performance, and visual effects. When merging two instances, unspecified values are inherited from the other instance, enabling layered configuration.

Methods

NameDescription
Equals (2 overloads)No summary available.
GetBitmapBlendingModeGets the value of the BitmapBlendingMode attached property for a visual.
GetBitmapInterpolationModeGets the value of the BitmapInterpolationMode attached property for a visual.
GetEdgeModeGets the value of the EdgeMode attached property for a visual.
GetHashCodeNo summary available.
GetRequiresFullOpacityHandlingGets the value of the RequiresFullOpacityHandling attached property for a visual.
GetTextRenderingModeGets the value of the TextRenderingMode attached property for a visual.
MergeWithNo summary available.
SetBitmapBlendingModeSets the value of the BitmapBlendingMode attached property for a visual.
SetBitmapInterpolationModeSets the value of the BitmapInterpolationMode attached property for a visual.
SetEdgeModeSets the value of the EdgeMode attached property for a visual.
SetRequiresFullOpacityHandlingNo summary available.
SetTextRenderingModeSets the value of the TextRenderingMode attached property for a visual.
ToStringNo summary available.

Equals overloads

Equals Method

public bool Equals(Avalonia.Media.RenderOptions other)
Parameters

other Avalonia.Media.RenderOptions

Returns

bool

Equals Method

public bool Equals(object obj)
Parameters

obj object

Returns

bool

GetBitmapBlendingMode Method

Gets the value of the BitmapBlendingMode attached property for a visual.

public Avalonia.Media.Imaging.BitmapBlendingMode GetBitmapBlendingMode(Avalonia.Visual visual)

Parameters

visual Avalonia.Visual

The control.

Returns

Avalonia.Media.Imaging.BitmapBlendingMode

The value.

GetBitmapInterpolationMode Method

Gets the value of the BitmapInterpolationMode attached property for a visual.

public Avalonia.Media.Imaging.BitmapInterpolationMode GetBitmapInterpolationMode(Avalonia.Visual visual)

Parameters

visual Avalonia.Visual

The control.

Returns

Avalonia.Media.Imaging.BitmapInterpolationMode

The value.

GetEdgeMode Method

Gets the value of the EdgeMode attached property for a visual.

public Avalonia.Media.EdgeMode GetEdgeMode(Avalonia.Visual visual)

Parameters

visual Avalonia.Visual

The control.

Returns

Avalonia.Media.EdgeMode

The value.

GetHashCode Method

public int GetHashCode()

Returns

int

GetRequiresFullOpacityHandling Method

Gets the value of the RequiresFullOpacityHandling attached property for a visual.

public Nullable<bool> GetRequiresFullOpacityHandling(Avalonia.Visual visual)

Parameters

visual Avalonia.Visual

The control.

Returns

Nullable<bool>

The value.

GetTextRenderingMode Method

Gets the value of the TextRenderingMode attached property for a visual.

public Avalonia.Media.TextRenderingMode GetTextRenderingMode(Avalonia.Visual visual)

Parameters

visual Avalonia.Visual

The control.

Returns

Avalonia.Media.TextRenderingMode

The value.

MergeWith Method

public Avalonia.Media.RenderOptions MergeWith(Avalonia.Media.RenderOptions other)

Parameters

other Avalonia.Media.RenderOptions

Returns

Avalonia.Media.RenderOptions

SetBitmapBlendingMode Method

Sets the value of the BitmapBlendingMode attached property for a visual.

public void SetBitmapBlendingMode(Avalonia.Visual visual, Avalonia.Media.Imaging.BitmapBlendingMode value)

Parameters

visual Avalonia.Visual

The control.

value Avalonia.Media.Imaging.BitmapBlendingMode

The left value.

SetBitmapInterpolationMode Method

Sets the value of the BitmapInterpolationMode attached property for a visual.

public void SetBitmapInterpolationMode(Avalonia.Visual visual, Avalonia.Media.Imaging.BitmapInterpolationMode value)

Parameters

visual Avalonia.Visual

The control.

value Avalonia.Media.Imaging.BitmapInterpolationMode

The value.

SetEdgeMode Method

Sets the value of the EdgeMode attached property for a visual.

public void SetEdgeMode(Avalonia.Visual visual, Avalonia.Media.EdgeMode value)

Parameters

visual Avalonia.Visual

The control.

value Avalonia.Media.EdgeMode

The value.

SetRequiresFullOpacityHandling Method

public void SetRequiresFullOpacityHandling(Avalonia.Visual visual, Nullable<bool> value)

Parameters

visual Avalonia.Visual

value Nullable<bool>

SetTextRenderingMode Method

Sets the value of the TextRenderingMode attached property for a visual.

public void SetTextRenderingMode(Avalonia.Visual visual, Avalonia.Media.TextRenderingMode value)

Parameters

visual Avalonia.Visual

The control.

value Avalonia.Media.TextRenderingMode

The value.

ToString Method

public string ToString()

Returns

string

Properties

NameDescription
BitmapBlendingModeGets the blending mode used when rendering bitmap images.
BitmapInterpolationModeGets the interpolation mode used when rendering bitmap images.
EdgeModeGets the edge rendering mode used for drawing operations.
RequiresFullOpacityHandlingGets a value indicating whether full opacity handling is required for the associated content.
TextRenderingModeGets the text rendering mode used to control how text glyphs are rendered.

BitmapBlendingMode Property

Gets the blending mode used when rendering bitmap images.

public Avalonia.Media.Imaging.BitmapBlendingMode BitmapBlendingMode { get; set; }

Remarks

The blending mode determines how bitmap pixels are composited with the background or other images. Select an appropriate mode based on the desired visual effect, such as transparency or additive blending.

BitmapInterpolationMode Property

Gets the interpolation mode used when rendering bitmap images.

public Avalonia.Media.Imaging.BitmapInterpolationMode BitmapInterpolationMode { get; set; }

Remarks

The interpolation mode determines how bitmap images are scaled or transformed during rendering. Selecting an appropriate mode can affect image quality and performance.

EdgeMode Property

Gets the edge rendering mode used for drawing operations.

public Avalonia.Media.EdgeMode EdgeMode { get; set; }

RequiresFullOpacityHandling Property

Gets a value indicating whether full opacity handling is required for the associated content.

public Nullable<bool> RequiresFullOpacityHandling { get; set; }

TextRenderingMode Property

Gets the text rendering mode used to control how text glyphs are rendered.

public Avalonia.Media.TextRenderingMode TextRenderingMode { get; set; }