THotPDF.RegisterSampledRadialGradient Method

Registers a reusable radial shading between a start circle and an end circle whose colours come from caller-supplied 8-bit DeviceRGB samples, so one sampled function spans the whole projected range of a repeating gradient

Declaration

function RegisterSampledRadialGradient(X0, Y0, R0, X1, Y1, R1, DomainT0, DomainT1: Single; const Samples: TBytes; SampleCount, Cycles: Integer): AnsiString;

Unit

HPDFDoc

Parameters

NamePurpose
X0, Y0, R0Centre and radius of the start circle
X1, Y1, R1Centre and radius of the end circle; this radius may be smaller than R0
DomainT0, DomainT1Input domain of the sampled function; supply the projected geometry span so the periodised samples already cover every cycle
SamplesSampleCount x 3 bytes of periodised 8-bit DeviceRGB sample colours
SampleCountNumber of samples; at least two
CyclesWhole-cycle count recorded as the pattern /Cycles entry so independent readers can recover the per-cycle unit scale

Return value

Returns the generated Pattern resource name for THPDFPage.SetFillPattern or THPDFPage.SetStrokePattern

Behaviour

Example

SetLength(Samples, 6 * 3);
// ... fill six periodized 8-bit RGB samples covering three cycles
PatternName := Document.RegisterSampledRadialGradient(
  300, 400, 0, 300, 400, 250, 0, 3, Samples, 6, 3);
Document.CurrentPage.SetFillPattern(PatternName);

Related APIs