VegaRise.NET
HomeAPI Reference
Back to DOM

TransformClass

Definition

Namespace
DOM.Elements.Graphics
Assembly
DOM.dll

Represents the complete transformation and layout properties for a graphic element.

Remarks

The class consolidates all spatial, positioning, and layout properties that can be applied to a graphic element (image, shape, etc.) within a document. It provides a unified API for controlling where and how a graphic appears on the page. Transform The transformation properties include: – Placement of the graphic using absolute coordinates or alignment Position – Width, height, and scaling of the graphic Dimensions – Angular rotation of the graphic Rotation – Spacing around the graphic Margin – Visual effects like shadows or reflections EffectExtent – Layering order relative to other elements ZIndex – How text flows around the graphic TextWrapping All properties are nullable to allow for incremental building of the graphic's visual presentation. Consumers should check for null values and apply appropriate defaults when rendering.

Examples

csharp
1// 1. Absolute position and size
2var transform = new Transform
3{
4 Position = new Position(100, 200, Units.pt),
5 Dimensions = new Dimensions(300, 200, Units.pt)
6};
7
csharp
1// 2. Centered on the page with a rotation
2var transform = new Transform
3{
4 Position = new Position(HorizontalAlignmentValues.Center, VerticalAlignmentValues.center),
5 Dimensions = new Dimensions(150, 150, Units.pt),
6 Rotation = new Rotation { Value = 45 }
7};
8
csharp
1// 3. Wrapped image with margins and z-order
2var transform = new Transform
3{
4 Position = new Position(0, 0, Units.pt),
5 Dimensions = new Dimensions(200, 100, Units.pt),
6 Margin = new Margin(6, 6, 6, 6, Units.pt),
7 ZIndex = 5,
8 TextWrapping = new TextWrapping { WrappingStyle = WrappingStyle.Square }
9};
10
csharp
1// 4. Use a factory method for concise construction
2var transform = Transform.CreateWithAbsolutePosition(
3 x: 50, y: 75,
4 width: 300, height: 200,
5 units: Units.pt);
6

Constructors

Transform()

Initializes a new instance of the class with default (null) values for all properties. Transform

Transform(Position position, Dimensions dimensions)

Initializes a new instance of the class with specified position and dimensions. Transform

Transform(Position position, Dimensions dimensions, Rotation rotation)

Initializes a new instance of the class with specified position, dimensions, and rotation. Transform

Properties

Dimensions

Gets or sets the dimensions (size) of the graphic.

The property defines the size of the graphic on the page. It supports both absolute sizing (using width and height with measurement units) and relative scaling (using scale percentages). Dimensions When both absolute dimensions and scale percentages are specified, the scale is applied relative to the absolute dimensions.

EffectExtent

Gets or sets the visual effect extent for the graphic.

The property controls how much space visual effects (such as drop shadows, glows, or reflections) occupy around the graphic. This ensures that effects are properly rendered without being clipped by the graphic's bounding box. EffectExtent

Margin

Gets or sets the margin space around the graphic.

Margins define the empty space between the graphic's outer boundary and surrounding content (such as text or other elements). Margins can be uniform (same value on all sides) or asymmetrical (different values for top, bottom, left, and right).

Position

Gets or sets the positioning of the graphic within its containing context.

The property controls where the graphic is placed on the page or within its container. It supports: Position Absolute positioning using X and Y coordinates Alignment-based positioning (centered, left, right, etc.) Mixed positioning (horizontal alignment with vertical absolute, and vice versa) Relative positioning reference frames (page, margin, paragraph, line, etc.)

Rotation

Gets or sets the rotation angle of the graphic.

Rotation is applied around the graphic's anchor point, which is typically the center of the bounding box or the position reference point. The rotation angle is automatically normalized to the range [0, 360) by the class. Positive values rotate clockwise, negative values rotate counterclockwise. Rotation

TextWrapping

Gets or sets the text wrapping behavior for the graphic.

The property controls the interaction between the graphic and surrounding text content. It supports various wrapping styles: TextWrapping Additional properties like and provide fine-grained control over the wrapping behavior. DistanceFromText WrapPolygon – The graphic is treated as an inline character InlineWithText – Text wraps around the graphic's rectangular bounding box Square – Text flows through the graphic Through – Text wraps only above and below TopAndBottum – The graphic overlays text InFrontOfText – The graphic is behind text BehindText

ZIndex

Gets or sets the Z-index (layering order) of the graphic.

The property controls the visual layering of the graphic relative to other overlapping elements. Elements with higher Z-index values are rendered in front of elements with lower values. ZIndex When Z-index is not specified, the natural document order determines the layering (later elements appear in front of earlier elements).

Methods

Creates a shallow copy of this instance. Transform

Creates a new instance with absolute positioning. Transform

Returns a string representation of the transformation properties.