VegaRise.NET
Back to DOM

BasePositionClass

Definition

Namespace
DOM.Elements.Graphics
Assembly
DOM.dll

Represents a two-dimensional position in document coordinates.

Remarks

is the simplest position holder in the DOM: an X and Y coordinate expressed with values. It is used by graphics (shapes, images, SVG paths), 3D camera rotations, and wrap-polygon geometry to express points in a common unit-aware form. BasePosition DocumentUnit Both and are nullable so that a position can be partially specified (for example, only the horizontal coordinate). X Y

Examples

csharp
1// 1. Create a position at (100pt, 200pt)
2var p = new BasePosition
3{
4 X = new DocumentUnit(100, Units.pt),
5 Y = new DocumentUnit(200, Units.pt)
6};
7
csharp
1// 2. Mix units on the same point
2var p = new BasePosition
3{
4 X = new DocumentUnit(2.5, Units.inch),
5 Y = new DocumentUnit(6, Units.cm)
6};
7
csharp
1// 3. Partial specification (only X set)
2var p = new BasePosition { X = new DocumentUnit(0, Units.pt) };
3
csharp
1// 4. Use in a wrap polygon
2var polygon = new List<BasePosition>
3{
4 new BasePosition { X = 0, Y = 0 },
5 new BasePosition { X = 50, Y = 0 },
6 new BasePosition { X = 50, Y = 30 },
7};
8

Properties

Gets or sets the horizontal coordinate.

Gets or sets the vertical coordinate.

VegaRise.NET

Sign In

Welcome back. Please sign in to your account.

Forgot password?
or

Don't have an account? Create an account

By signing in, you agree to our Terms of Service and Privacy Policy.