VegaRise.NET
Back to Shape

SetMarginMethod

Definition

Namespace
DOM.Elements.Graphics
Assembly
DOM.dll

Overloads

SetMargin(double margin, Units units)

Sets uniform margins around the graphic.

SetMargin(double top, double bottom, double left, double right, Units units)

Sets individual margins for each side of the graphic.

SetMargin(Margin margin)

Sets individual margins using a pre-configured object. Margin

SetMargin(double margin, Units units)

SetMargin(double margin, Units units)

Sets uniform margins around the graphic.

Parameters

margin
Margin value to apply to all sides.
units
Measurement unit for the margin (default: points).

Remarks

Margins define the space between the graphic and surrounding content. The method automatically initializes if it is . Transform null

SetMargin(double top, double bottom, double left, double right, Units units)

SetMargin(double top, double bottom, double left, double right, Units units)

Sets individual margins for each side of the graphic.

Parameters

top
Top margin value.
bottom
Bottom margin value.
left
Left margin value.
right
Right margin value.
units
Measurement unit for the margins (default: points).

Remarks

This method allows asymmetric margins, which is useful for fine-tuning the spacing around the graphic.

SetMargin(Margin margin)

SetMargin(Margin margin)

Sets individual margins using a pre-configured object. Margin

Parameters

margin
The margin object containing all four margin values.

Examples

SetMargin(double margin, Units units)

csharp
1var graphic = new Graphic();
2graphic.SetMargin(10, Units.pt); // 10pt margin on all sides
3

SetMargin(double top, double bottom, double left, double right, Units units)

csharp
1var graphic = new Graphic();
2graphic.SetMargin(10, 5, 15, 8, Units.pt);
3// Top: 10pt, Bottom: 5pt, Left: 15pt, Right: 8pt
4
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.