THotPDF.RegisterMultiStopAxialGradient Method
Registers a reusable native PDF axial shading that interpolates two or more color stops along the axis from (X0, Y0) to (X1, Y1)
Declaration
function RegisterMultiStopAxialGradient(X0, Y0, X1, Y1: Single; const StopPositions: array of Single; const StopColors: array of Single; ComponentsPerStop: Integer): AnsiString;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
X0, Y0 | Finite coordinates at color-line offset zero |
X1, Y1 | Finite coordinates at color-line offset one |
StopPositions | Two or more nondecreasing finite offsets in [0, 1]; equal neighbors form a hard color stop |
StopColors | Flat-packed finite color components in [0, 1], with one complete color per stop |
ComponentsPerStop | 1 for DeviceGray, 3 for DeviceRGB or 4 for DeviceCMYK |
Return value
Returns the generated Pattern resource name for THPDFPage.SetFillPattern or THPDFPage.SetStrokePattern
Usage notes
- Uses constant first and last colors outside the authored stop interval, including omitted zero and one endpoints
- Uses positive-width function intervals with the original stop parameter scale; repeated offsets preserve a hard transition without duplicate stitching boundaries
- Repeated zero or one offsets expand the shading axis and domain to preserve both the outside pad color and the inside color limit
- Requires PDF 1.3 and follows the document version-lock policy