API referenceReporting

tblSetCellImageEx

Place an image in a cell, sourced from a file path (A/W)

C
BOOL32 __stdcall tblSetCellImageA(ITBL Table, int32_t Row, int32_t Col, BOOL32 ForeGround, TCellAlign HAlign, TCellAlign VAlign, float Width, float Height, const char* Image, uint32_t Index);
BOOL32 __stdcall tblSetCellImageEx(ITBL Table, int32_t Row, int32_t Col, BOOL32 ForeGround, TCellAlign HAlign, TCellAlign VAlign, float Width, float Height, void* Buffer, uint32_t BufSize, uint32_t Index);
Delphi
function tblSetCellImageA(const Table: ITBL; Row, Col: Integer; ForeGround: LongBool; HAlign, VAlign: TCellAlign; Width, Height: Single; const Image: PAnsiChar; Index: Cardinal): LongBool; stdcall;
function tblSetCellImageEx(const Table: ITBL; Row, Col: Integer; ForeGround: LongBool; HAlign, VAlign: TCellAlign; Width, Height: Single; const Buffer: Pointer; BufSize, Index: Cardinal): LongBool; stdcall;

Purpose. Place an image in a cell, sourced from a file path (A/W) or an in-memory encoded buffer (Ex).

Description. All three store into the same real TTableCell fields (HasImage/ImgName/ImgBuf/ImgFG/ImgHA/ImgVA/ImgW/ ImgH/ImgIndex) — the actual file/buffer decode presumably happens later, at tblDrawTable time (not traced further in this chapter). ForeGround selects whether the image paints over cell text/background (True) or beneath it (False). tblSetCellImageW's Image path is silently truncated to Latin-1 per the chapter-wide finding above — a non-ASCII file path passed via the W form will fail to resolve to the real file.

Parameters.

ParameterDescription
TableTarget table handle.
Row, Col0-based cell coordinates (correctly Integer here, unlike tblSetCellText).
ForeGroundTrue = image paints over text/background; False = beneath.
HAlign, VAlignImage alignment within the cell.
Width, HeightImage display size.
Image*(A/W)* File path; W truncated to Latin-1.
Buffer, BufSize*(Ex only)* In-memory encoded image bytes.
IndexPresumably a multi-frame image's frame index (consistent with the SDK-wide Index convention for GIF/TIFF frame selection, V07); not independently confirmed in this chapter.

Return value. True if Row/Col are in range.

C# (P/Invoke)

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

Misc

Exported names

tblSetCellImageEx

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.