Table of Contents

Interface ITransformContext

Namespace
Xui.Core.Canvas
Assembly
Core.dll

Provides methods for manipulating the current transformation matrix of the drawing context. This includes translation, scaling, rotation, and applying affine transformations. Mirrors the transformation API of the HTML5 Canvas 2D context.

public interface ITransformContext

Methods

Rotate(NFloat)

Applies a clockwise rotation to the current transform.

void Rotate(NFloat angle)

Parameters

angle NFloat

The rotation angle in radians.

Scale(Vector)

Applies a scaling transformation using the specified scaling factors.

void Scale(Vector vector)

Parameters

vector Vector

The scaling vector (sx, sy).

SetTransform(AffineTransform)

Resets the current transformation matrix to the identity matrix, then replaces it with the specified transform. Equivalent to ctx.setTransform(...) in HTML5 Canvas.

void SetTransform(AffineTransform transform)

Parameters

transform AffineTransform

The new transformation matrix to apply.

Transform(AffineTransform)

Multiplies the current transformation matrix by the specified matrix. This is equivalent to applying an additional transformation on top of the existing one.

void Transform(AffineTransform matrix)

Parameters

matrix AffineTransform

The matrix to multiply with the current transform.

Translate(Vector)

Applies a translation by the specified vector. This offsets all subsequent drawing operations by the given amount.

void Translate(Vector vector)

Parameters

vector Vector

The translation vector (dx, dy).