int32_t __stdcall pdfSelectImage(PPDF IPDF, int32_t ImageID);
int32_t __stdcall pdfSelectedImage(PPDF IPDF);
function pdfSelectImage(const IPDF: PPDF; ImageID: Integer): Integer; stdcall;
function pdfSelectedImage(const IPDF: PPDF): Integer; stdcall;
Purpose. Set/get a document-level "currently selected image" cursor — a third, independent notion of "the current image" alongside pdfGetImageHandle(IPDF, nil)'s "last inserted" and pdfCreateImageObj's standalone PIMG snapshots.
Description. pdfSelectImage(0) clears the selection (always succeeds); any other ImageID must be within 1..FImageCount or the call fails and the selection is left unchanged. This cursor is consulted by a small number of image-editing entry points that operate on "the currently selected image" rather than taking a handle parameter directly — confirmed consumer: pdfReverseImage (Image Insertion and Replacement), which flips/restores whichever image pdfSelectImage last selected.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
ImageID | 0 = clear selection; 1..ImageCount = select that image; any other value fails. |
Return value. pdfSelectImage: 1 on success, 0 if ImageID is out of range. pdfSelectedImage: the currently selected image handle, or 0 if none is selected / IPDF invalid.
See also. pdfReverseImage, pdfGetImageHandle (a different "current image" concept).
C# (P/Invoke)
public static extern int pdfSelectImage(IntPtr IPDF, int ImageID);
Core
pdfSelectImage
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.