API referenceRendering & Viewer

rasInitMainTile

Attach the caller's "main tile" pixel buffer to the page

C
BOOL32 __stdcall rasInitMainTile(IPGC CachePtr, void* Buffer, uint32_t Width, uint32_t Height, int32_t Stride, TPDFPixFormat PixFmt);
Delphi
function rasInitMainTile(CachePtr: IPGC; const Buffer: Pointer; Width, Height: Cardinal; Stride: Integer; PixFmt: TPDFPixFormat): LongBool; stdcall;

Purpose. Attach the caller's "main tile" pixel buffer to the page cache — the primary on-screen render target the tile/update pipeline (Rendering, Painting, and the Tile Pipeline) draws into.

Description. Stores Buffer/Width/Height/Stride/PixFmt directly (the buffer is used in place, never copied — caller retains ownership and must keep it valid and appropriately sized for the cache's lifetime), resets HasLastTile (invalidating any previously cached tile), and pre-fills the entire buffer to $FF (white) via FillChar — a real, immediate side effect on the caller's memory, not merely bookkeeping.

Parameters.

ParameterDescription
CachePtrTarget page cache.
BufferCaller-owned pixel buffer, used in place; immediately filled with $FF.
Width, Height, Stride, PixFmtBuffer geometry/format, stored as-is.

Return value. True if CachePtr resolves; False otherwise.

C# (P/Invoke)

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

Rasterizer/Rendering

Exported names

rasInitMainTile

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.