API referenceRendering & Viewer

rasAttachImageBuffer

Re-point an existing IRAS rasterizer at a different

C
BOOL32 __stdcall rasAttachImageBuffer(IRAS RasPtr, void** Rows, void* Buffer, uint32_t Width, uint32_t Height, int32_t ScanlineLen);
Delphi
function rasAttachImageBuffer(RasPtr: IRAS; Rows: PPointer; Buffer: Pointer; Width, Height: Cardinal; ScanlineLen: Integer): LongBool; stdcall;

Purpose. Re-point an existing IRAS rasterizer at a different caller-owned buffer (without recreating the whole rasterizer handle), and immediately re-render into it.

Description. Updates R.Buffer/Width/Height/ScanlineLen and calls RasBlitPage0 immediately — the same eager-render-at-attach pattern as rasCreateRasterizer (Rasterizer and Page-Cache Lifecycle). Rows is accepted but, like rasCreateRasterizer's equivalent parameter, not observed to be consulted.

Parameters.

ParameterDescription
RasPtrTarget rasterizer.
RowsAccepted; not observed to be used.
BufferNew caller-owned buffer, used in place; immediately rendered into.
Width, Height, ScanlineLenNew buffer geometry.

Return value. True if Buffer <> nil (note: this checks the buffer pointer, not whether RasPtr itself resolved — a nil RasPtr with a non-nil Buffer argument still returns True despite doing nothing, since the Exit(False) guard is keyed on R = nil, which is a separate, earlier check — so the True result specifically reflects Buffer <> nil at the point execution reaches it, which only happens after R <> nil already passed).

C# (P/Invoke)

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

Rasterizer/Rendering

Exported names

rasAttachImageBuffer

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.