API referenceGraphics

pdfSetColors

Convenience call that sets both the fill and stroke color

C
BOOL32 __stdcall pdfSetColors(PPDF IPDF, uint32_t Color);
Delphi
function pdfSetColors(const IPDF: PPDF; Color: Cardinal): LongBool; stdcall;

Purpose. Convenience call that sets both the fill and stroke color from the same packed value in one call.

Description. Equivalent to calling pdfSetFillColor(IPDF, Color) followed by pdfSetStrokeColor(IPDF, Color), except it is one content-stream write of two color operators instead of two separate API calls: emits a fill-color operator against FFillCS and a stroke-color operator against FStrokeCS, both using Color. FFillCS and FStrokeCS may differ (e.g. after using pdfSetFillColorSpace/pdfSetStrokeColorSpace independently), in which case the same packed Color value is interpreted twice, once against each active space.

Parameters.

ParameterDescription
IPDFDocument handle.
ColorPacked color value applied to both fill and stroke.

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

See also. pdfSetFillColor, pdfSetStrokeColor.

C# (P/Invoke)

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

Setters

Exported names

pdfSetColors

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.