API reference › Rendering & Viewer
rasInitMainTile
Attach the caller's "main tile" pixel buffer to the page
BOOL32 __stdcall rasInitMainTile(IPGC CachePtr, void* Buffer, uint32_t Width, uint32_t Height, int32_t Stride, TPDFPixFormat PixFmt);
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.
| Parameter | Description |
|---|---|
CachePtr | Target page cache. |
Buffer | Caller-owned pixel buffer, used in place; immediately filled with $FF. |
Width, Height, Stride, PixFmt | Buffer geometry/format, stored as-is. |
Return value. True if CachePtr resolves; False otherwise.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Rasterizer/Rendering
rasInitMainTile
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.