int32_t __stdcall pdfGetImageHandle(PPDF IPDF, void* ImagePtr);
function pdfGetImageHandle(const IPDF: PPDF; ImagePtr: Pointer): Integer; stdcall;
Purpose. Resolve a PIMG standalone object handle back to its originating document image handle, or (when ImagePtr is null) return the most recently inserted image's handle.
Description. Two distinct modes selected purely by whether ImagePtr is nil: with ImagePtr = nil, returns D.GetLastImageHandle — the document's most-recently-added image handle, regardless of what is currently "selected" via pdfSelectImage (a separate cursor, see below); with a non-null ImagePtr, resolves it as a PIMG (from pdfCreateImageObj) and returns the Handle that object remembered at mint time — this does not re-verify that the originating document image handle still exists or is unchanged; a PIMG snapshot outlives mutations to (or even replacement of) its source image.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle (only consulted in the ImagePtr = nil mode). |
ImagePtr | nil = query the last-inserted image; non-null = a PIMG from pdfCreateImageObj to resolve back to its origin handle. |
Return value. The resolved image handle; -1 if IPDF is invalid (nil mode) or ImagePtr doesn't resolve to a live PIMG.
See also. pdfCreateImageObj, pdfSelectedImage (a third, independent "current image" concept — do not confuse the three).
C# (P/Invoke)
public static extern int pdfGetImageHandle(IntPtr IPDF, IntPtr ImagePtr);
Getters
pdfGetImageHandle
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.