THotPDF.RegisterMultiStopRadialGradient Method

Registers a reusable native PDF radial shading that interpolates two or more color stops between an inner circle and an outer circle

Declaration

function RegisterMultiStopRadialGradient(X0, Y0, R0, X1, Y1, R1: Single; const StopPositions: array of Single; const StopColors: array of Single; ComponentsPerStop: Integer): AnsiString;

Unit

HPDFDoc

Parameters

NamePurpose
X0, Y0, R0Center and non-negative radius of the inner circle
X1, Y1, R1Center and non-negative radius of the outer circle
StopPositionsTwo or more strictly increasing finite offsets in the inclusive range zero to one
StopColorsFlat-packed finite color components in the inclusive range zero to one
ComponentsPerStop1 selects DeviceGray, 3 selects DeviceRGB, and 4 selects DeviceCMYK

Return value

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

Behavior

Example

PatternName := Document.RegisterMultiStopRadialGradient(
  300, 400, 0, 300, 400, 250,
  [0.0, 0.5, 1.0],
  [1.0, 0.0, 0.0,
   0.0, 1.0, 0.0,
   0.0, 0.0, 1.0], 3);
Document.CurrentPage.SetFillPattern(PatternName);

Related APIs