THotPDF.RegisterMultiStopAxialGradient Method
Registers a reusable native PDF axial shading that interpolates two or more colour 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 colour-line offset zero |
X1, Y1 | Finite coordinates at colour-line offset one |
StopPositions | Two or more nondecreasing finite offsets in [0, 1]; equal neighbours form a hard colour stop |
StopColors | Flat-packed finite colour components in [0, 1], with one complete colour 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 colours 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 colour and the inside colour limit
- Requires PDF 1.3 and follows the document version-lock policy