Class ShadingContent
A shading painted as a content element in a content stream (spec §8.7.4). The shading fills a region using a gradient pattern defined by a shading dictionary.
Inherited Members
Namespace: DRIT.Pdf.Content
Assembly: DRIT.Pdf.dll
Syntax
public sealed class ShadingContent : VisualContentElement
Constructors
ShadingContent(string, string, IReadOnlyList<(double Position, PdfColor Color)>, PdfRect)
Initializes a shading content element.
Declaration
public ShadingContent(string shadingType, string colorSpace, IReadOnlyList<(double Position, PdfColor Color)> stops, PdfRect clipRegion)
Parameters
| Type | Name | Description |
|---|---|---|
| string | shadingType | |
| string | colorSpace | |
| IReadOnlyList<(double Position, PdfColor Color)> | stops | |
| PdfRect | clipRegion |
Properties
Bounds
Bounding box of this element in the page's user-space coordinate system (origin at lower-left, y-up, units = points).
Declaration
public override PdfRect Bounds { get; }
Property Value
| Type | Description |
|---|---|
| PdfRect |
Overrides
ClipRegion
Gets the clip rectangle that bounds the shading region.
Declaration
public PdfRect ClipRegion { get; }
Property Value
| Type | Description |
|---|---|
| PdfRect |
ColorSpace
Gets the color space name used by this shading.
Declaration
public string ColorSpace { get; }
Property Value
| Type | Description |
|---|---|
| string |
ElementType
The type of this content element.
Declaration
public override ContentElementType ElementType { get; }
Property Value
| Type | Description |
|---|---|
| ContentElementType |
Overrides
ShadingType
Gets the shading type name (Axial, Radial, etc.).
Declaration
public string ShadingType { get; }
Property Value
| Type | Description |
|---|---|
| string |
Stops
Gets the gradient stops as (position, color) pairs.
Declaration
public IReadOnlyList<(double Position, PdfColor Color)> Stops { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<(double Position, PdfColor Color)> |
Methods
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |