Back to DOM
FillToRectangleClass
Definition
- Namespace
- DOM.Elements.Graphics.Colors
- Assembly
- DOM.dll
Represents a rectangular region that receives a path-based gradient fill.
Remarks
defines the four edges of a rectangle as percentages relative to the shape's bounding box. It is used by to control where a path (radial or rectangular) gradient begins and ends. FillToRectangle PathShade All four properties are values in the 0–100 range. Percentage
Examples
csharp
1// 1. Whole shape (default rectangle)
2var rect = new FillToRectangle { Top = 0, Left = 0, Right = 100, Bottom = 100 };
3
csharp
1// 2. Centered rectangle (radial gradient inside a smaller area)
2var rect = new FillToRectangle { Top = 25, Left = 25, Right = 75, Bottom = 75 };
3
csharp
1// 3. Top-right quadrant only
2var rect = new FillToRectangle { Top = 0, Left = 50, Right = 100, Bottom = 50 };
3
csharp
1// 4. Attach to a PathShade
2var shade = new PathShade { FillToRectangle = rect, PathShadeType = PathShadeTypeValues.circle };
3
Properties
Bottom
Gets or sets the bottom edge percentage of the fill rectangle.
Left
Gets or sets the left edge percentage of the fill rectangle.
Right
Gets or sets the right edge percentage of the fill rectangle.
Top
Gets or sets the top edge percentage of the fill rectangle.