VegaRise.NET
Back to Graphic

SetPositionMethod

Definition

Namespace
DOM.Elements.Graphics
Assembly
DOM.dll

Overloads

SetPosition(double x, double y, Units units)

Sets the absolute position of the graphic using the specified coordinates and units.

SetPosition(DocumentUnit x, DocumentUnit y)

Sets the absolute position of the graphic using pre-configured DocumentUnit values.

SetPosition(HorizontalAlignmentValues horizontalAlignment, double y, Units units)

Sets the position of the graphic using mixed positioning (horizontal alignment with vertical absolute offset).

SetPosition(double x, VerticalAlignmentValues verticalAlignment, Units units)

Sets the position of the graphic using mixed positioning (horizontal absolute offset with vertical alignment).

SetPosition(double x, double y, Units units)

SetPosition(double x, double y, Units units)

Sets the absolute position of the graphic using the specified coordinates and units.

Parameters

x
Horizontal position value.
y
Vertical position value.
units
Measurement unit for the position values (default: points).

Remarks

This method configures the graphic for absolute positioning, which places the element at a fixed location relative to the page or margin reference. The method automatically initializes and properties if they are, and ensures that absolute positioning mode is enabled (clearing any previous alignment-based positioning). Transform Position null

SetPosition(DocumentUnit x, DocumentUnit y)

SetPosition(DocumentUnit x, DocumentUnit y)

Sets the absolute position of the graphic using pre-configured DocumentUnit values.

Parameters

x
Horizontal position as . DocumentUnit
y
Vertical position as . DocumentUnit

Remarks

This overload is useful when you have already created instances with specific units and want to reuse them for positioning. DocumentUnit

SetPosition(HorizontalAlignmentValues horizontalAlignment, VerticalAlignmentValues verticalAlignment)

SetPosition(HorizontalAlignmentValues horizontalAlignment, VerticalAlignmentValues verticalAlignment)

Sets the position of the graphic using alignment-based positioning.

Parameters

horizontalAlignment
Horizontal alignment within the reference frame.
verticalAlignment
Vertical alignment within the reference frame.

Remarks

Alignment-based positioning places the element relative to its and reference frames. HorizontalRelativePosition VerticalRelativePosition When alignment is used, any absolute offset values are cleared (set to 0) to maintain consistency.

SetPosition(HorizontalAlignmentValues horizontalAlignment, double y, Units units)

SetPosition(HorizontalAlignmentValues horizontalAlignment, double y, Units units)

Sets the position of the graphic using mixed positioning (horizontal alignment with vertical absolute offset).

Parameters

horizontalAlignment
Horizontal alignment within the reference frame.
y
Vertical offset value.
units
Measurement unit for the vertical offset (default: points).

Remarks

This method is useful when you want the graphic to be aligned horizontally (e.g., centered) but positioned at a specific vertical location on the page.

SetPosition(double x, VerticalAlignmentValues verticalAlignment, Units units)

SetPosition(double x, VerticalAlignmentValues verticalAlignment, Units units)

Sets the position of the graphic using mixed positioning (horizontal absolute offset with vertical alignment).

Parameters

x
Horizontal offset value.
verticalAlignment
Vertical alignment within the reference frame.
units
Measurement unit for the horizontal offset (default: points).

Remarks

This method is useful when you want the graphic to be aligned vertically (e.g., centered) but positioned at a specific horizontal location on the page.

Examples

SetPosition(double x, double y, Units units)

csharp
1var graphic = new Graphic();
2graphic.SetPosition(100, 200, Units.pt); // Position at (100pt, 200pt)
3

SetPosition(DocumentUnit x, DocumentUnit y)

csharp
1var graphic = new Graphic();
2var x = new DocumentUnit(50, Units.mm);
3var y = new DocumentUnit(75, Units.mm);
4graphic.SetPosition(x, y);
5

SetPosition(HorizontalAlignmentValues horizontalAlignment, VerticalAlignmentValues verticalAlignment)

csharp
1var graphic = new Graphic();
2graphic.SetPosition(
3 HorizontalAlignmentValues.Center,
4 VerticalAlignmentValues.Center
5); // Centers the graphic on the page
6

SetPosition(HorizontalAlignmentValues horizontalAlignment, double y, Units units)

csharp
1var graphic = new Graphic();
2graphic.SetPosition(HorizontalAlignmentValues.Center, 150, Units.pt);
3// Centers horizontally, positioned 150pt from top
4

SetPosition(double x, VerticalAlignmentValues verticalAlignment, Units units)

csharp
1var graphic = new Graphic();
2graphic.SetPosition(100, VerticalAlignmentValues.Center, Units.pt);
3// Positions 100pt from left, centered vertically
4
VegaRiseVDocs.NET

Reset Password

Enter your email and we'll send you a link to reset your password.

Remember your password? Sign in