API reference › Rendering & Viewer
rasGetPageMatrix
Nominally: resolve the page-to-device transform matrix for
int32_t __stdcall rasGetPageMatrix(IPGC CachePtr, int32_t CursorX, int32_t CursorY, int32_t* DestX, int32_t* DestY, int32_t* Width, int32_t* Height, TCTM* Matrix);
function rasGetPageMatrix(CachePtr: IPGC; CursorX, CursorY: Integer; var DestX, DestY, Width, Height: Integer; var Matrix: TCTM): Integer; stdcall;
Purpose. Nominally: resolve the page-to-device transform matrix for whichever page is under a given cursor position.
Description. Ignored parameters: CursorX/CursorY are never read anywhere in the implementation — the function unconditionally computes and returns the matrix for C.CurrPage (the cache's stored current page), not any page located via the cursor position, despite the parameter names strongly implying rasGetPageAt-style hit-testing. Computes DestY by summing every prior page's rendered height plus borders (same accumulation pattern as rasGetPageAt/rasGetPagePos), offsets by the cache's current ScrollX/ScrollY, and fills Matrix as a pure scale+translate (a = d = Zoom, x = DestX, y = DestY, b = c = 0 — no rotation/skew terms are populated even though TCTM supports them).
Parameters.
| Parameter | Description |
|---|---|
CachePtr | Target page cache. |
CursorX, CursorY | Accepted but never read — the function always operates on CachePtr's current page, not a cursor-located one. |
DestX, DestY | Output: the page's top-left in scrolled viewport coordinates. |
Width, Height | Output: the page's rendered pixel size at current zoom. |
Matrix | Output: scale+translate only (a=d=Zoom; rotation/skew always 0). |
Return value. The current page number on success; 0 if CachePtr/document/page size doesn't resolve.
C# (P/Invoke)
public static extern int rasGetPageMatrix(IntPtr CachePtr, int CursorX, int CursorY, ref int DestX, ref int DestY, ref int Width, ref int Height, ref TCTM Matrix);
Rasterizer/Rendering
rasGetPageMatrix
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.