API referenceRendering & Viewer

rasResizeBitmap

rasResize/rasResizeViewport resize an IPGC page

C
BOOL32 __stdcall rasResize(IPGC CachePtr, int32_t Width, int32_t Height);
BOOL32 __stdcall rasResizeBitmap(IRAS RasPtr, HDC DC, uint32_t Width, uint32_t Height);
void __stdcall rasResizeViewport(IPGC CachePtr, float Width, float Height);
Delphi
function rasResize(CachePtr: IPGC; Width, Height: Integer): LongBool; stdcall;
function rasResizeBitmap(RasPtr: IRAS; DC: HDC; Width, Height: Cardinal): LongBool; stdcall;
procedure rasResizeViewport(CachePtr: IPGC; Width, Height: Single); stdcall;

Purpose. rasResize/rasResizeViewport resize an IPGC page cache's viewport; rasResizeBitmap resizes and re-renders an IRAS rasterizer's own buffer.

Description. rasResize and rasResizeViewport are functionally identical (both just set C.Width/C.Height, one taking Integer, the other Single, rounded) — genuinely interchangeable, two ABI entry points for one effect, no DC parameter on either despite rasResizeBitmap accepting one. rasResizeBitmap was historically a no-op (per an inline comment: "G-06: real resize ... Was a no-op that stored W/H and returned True") and is now fully implemented: it updates R.Width/R.Height, recomputes R.ScanlineLen for RGB/BGR pixel formats (3 * Width, tight-packed — no stride padding), and immediately re-renders the active page into the resized buffer via RasBlitPage0. DC is accepted by rasResizeBitmap's ABI but this resize path itself does not blit anywhere (blitting is a separate step via rasRedraw/rasPaint, Rendering, Painting, and the Tile Pipeline).

Parameters.

ParameterDescription
CachePtr*(Resize/ResizeViewport)* Target page cache.
RasPtr*(ResizeBitmap)* Target rasterizer; immediately re-rendered after resizing.
DC*(ResizeBitmap)* Accepted; not used by the resize/re-render itself.
Width, HeightNew dimensions.

Return value. rasResize/rasResizeBitmap: True if the target resolves; False otherwise. rasResizeViewport: none (procedure).

C# (P/Invoke)

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

Rasterizer/Rendering

Exported names

rasResizeBitmap

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.