API referenceGraphics

pdfSetFillColorF

Set the fill (resp. stroke) color from a float array, each

C
BOOL32 __stdcall pdfSetFillColorF(PPDF IPDF, float* Color, uint32_t NumComponents);
BOOL32 __stdcall pdfSetStrokeColorF(PPDF IPDF, float* Color, uint32_t NumComponents);
Delphi
function pdfSetFillColorF(const IPDF: PPDF; Color: PSingle; NumComponents: Cardinal): LongBool; stdcall;
function pdfSetStrokeColorF(const IPDF: PPDF; Color: PSingle; NumComponents: Cardinal): LongBool; stdcall;

Purpose. Set the fill (resp. stroke) color from a float array, each component already normalized to 0.0..1.0.

Description. Identical to pdfSetFillColorEx/pdfSetStrokeColorEx in every respect except that the NumComponents values read from Color are Single floats already in 0.0..1.0 and are passed through to EmitColorComps without the /255.0 normalization the Ex variant applies. Passing a byte-range value (e.g. 255.0) here will saturate/clip rather than normalize — the two entry points are not interchangeable despite accepting the same component count.

Parameters.

ParameterDescription
IPDFDocument handle.
ColorPointer to NumComponents floats, each 0.0..1.0.
NumComponentsNumber of color components.

Return value. True on success; False if there is no current content stream.

See also. pdfSetFillColorEx (byte/255 variant).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Graphics
Category

Setters

Exported names

pdfSetFillColorF

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.