API reference › Rendering & Viewer
rasUpdate
Request a repaint — optionally switching the current page
void __stdcall rasUpdate(IPGC CachePtr, int32_t PageNum);
procedure rasUpdate(CachePtr: IPGC; PageNum: Integer); stdcall;
Purpose. Request a repaint — optionally switching the current page first — through whichever of two independent host-notification mechanisms are configured: a registered paint callback, and/or a bound window handle.
Description. If PageNum > 0, sets C.CurrPage first (no range clamping here, unlike rasSetCurrPage, Page Navigation, Layout, and Geometry). Then, independently: (1) if a paint callback is registered (rasSetOnPaintCallback, below), invokes it with the full viewport rect — per an inline comment, this was previously silently discarded and now genuinely fires; (2) if C.WndHandle is set (rasSetWindowHandle, Rasterizer and Page-Cache Lifecycle), performs a complete independent re-render of the current page — fetching its content bytes fresh, building render resources, calling RenderPageToRGB at the window's own client size, and painting the result directly to the window via ViewerPaintToWindow — not going through rasPaint's page-cache/tile machinery at all, a separate, simpler direct-to-window render path. Both mechanisms can fire from the same call if both are configured.
Parameters.
| Parameter | Description |
|---|---|
CachePtr | Target page cache. |
PageNum | > 0 switches the current page (unclamped) before repainting; ≤ 0 repaints the existing current page. |
Return value. None.
C# (P/Invoke)
public static extern void rasUpdate(IntPtr CachePtr, int PageNum);
Rasterizer/Rendering
rasUpdate
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.