VegaRise.NET
Back to DOM

DimensionsClass

Definition

Namespace
DOM.Elements.Graphics
Assembly
DOM.dll

Represents the width and height of a graphic element, plus optional scale factors.

Remarks

is used by images, shapes, page sizes, and other graphical elements. The base width and height are values so they can be expressed in any supported unit; the optional and provide percentage-based scaling relative to the base size. Dimensions DocumentUnit ScaleWidth ScaleHeight Scaling is applied at render time and does not change the base or values. Width Height

Examples

csharp
1// 1. Dimensions in inches
2var dims = new Dimensions(8.5, 11.0, Units.inch);
3
csharp
1// 2. Dimensions in centimeters (A4)
2var a4 = new Dimensions(21.0, 29.7, Units.cm);
3
csharp
1// 3. Set dimensions and apply 50% scaling
2var dims = new Dimensions(200, 100, Units.pt)
3{
4 ScaleWidth = 50,
5 ScaleHeight = 50
6};
7
csharp
1// 4. Modify a single axis after construction
2var dims = new Dimensions(100, 100, Units.pt);
3dims.Width = new DocumentUnit(200, Units.pt);
4

Constructors

Dimensions()

Initialises a new, empty instance. Dimensions

Dimensions(double width, double height, Units unit)

Initialises a new instance from a width and height in a specified unit. Dimensions

Properties

Gets or sets the height of the element.

ScaleHeightPercentage

Gets or sets an optional vertical scale percentage.

ScaleWidthPercentage

Gets or sets an optional horizontal scale percentage.

Gets or sets the width of the element.

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.