VegaRise.NET
HomeAPI Reference
Back to DOM

TextWrappingClass

Definition

Namespace
DOM.Elements.Graphics
Assembly
DOM.dll

Represents the text wrapping behaviour applied to a floating graphic element.

Remarks

defines how text flows around an image, shape, or other floating element: whether it wraps on both sides, one side, above and below, or flows through the element. It also carries the distance to reserve between the graphic and surrounding text and an optional custom wrap polygon for tight wrapping around non-rectangular shapes. TextWrapping This class is used by and by the fluent helpers on such as,, and . TextWrapping Graphic SetWrappingStyle SetBehindDocument SetWrapPolygon

Examples

csharp
1// 1. Square wrap with 6pt padding
2var wrap = new TextWrapping
3{
4 WrappingStyle = WrappingStyle.Square,
5 DistanceFromText = new Margin(6, 6, 6, 6, Units.pt)
6};
7
csharp
1// 2. Wrap only above and below the graphic
2var wrap = new TextWrapping
3{
4 WrappingStyle = WrappingStyle.TopAndBottum
5};
6
csharp
1// 3. Place the graphic behind text
2var wrap = new TextWrapping
3{
4 WrappingStyle = WrappingStyle.BehindText,
5 BehindDoc = true
6};
7
csharp
1// 4. Tight wrap with a custom polygon
2var wrap = new TextWrapping
3{
4 WrappingStyle = WrappingStyle.Through,
5 WrapPolygon = new List<BasePosition>
6 {
7 new BasePosition { X = 0, Y = 0 },
8 new BasePosition { X = 50, Y = 0 },
9 new BasePosition { X = 50, Y = 30 },
10 new BasePosition { X = 0, Y = 30 },
11 }
12};
13

Properties

BehindDoc

Gets or sets a value indicating whether the element is drawn behind the document text.

DistanceFromTextMargin

Gets or sets the padding between the graphic and surrounding text.

WrappingStyle

Gets or sets the wrapping style used around the graphic.

WrapPolygonBasePosition

Gets or sets an optional custom wrap polygon for tight wrapping.

Gets or sets the sides on which text is allowed to wrap.