DynaPDF Manual - Page 546
Previous Page 545 Index Next Page 547
Function Reference
Page 546 of 839
Return values:
If the function succeeds the return value is the image handle, a value greater or equal zero. If the
function fails the return value is a negative error code.
InsertImageFromBuffer
Syntax:
SI32 pdfInsertImageFromBuffer(
const PPDF* IPDF,
// Instance pointer
double PosX,
// X-Coordinate of destination rectangle
double PosY,
// Y-Coordinate of destination rectangle
double ScaleWidth,
// Scaled width of destination rectangle
double ScaleHeight, // Scaled height of destination rectangle
const void* Buffer, // Pointer to image buffer
UI32 BufSize,
// Buffer size
UI32 Index)
// Image index of a multi page image
The function inserts an image in exactly the same way as InsertImageEx(), but it accepts a file buffer
as input. A specific image of a multi-page image can be selected with the parameter Index; the first
image is denoted by the index 1. If the image file is not a multi-page image, the parameter Index will
be ignored. To determine the number of images stored in an image file use the function
GetImageCount() or GetImageCountEx(). The usage of the function is described in detail at
InsertImageEx().
Remarks:
DynaPDF applies always a duplicate check when inserting an image. To enable an efficient
duplicate check a MD5 hash is build from all image parameters and from the image buffer.
Although the calculation of a MD5 hash is very fast, it is significantly slower in comparison to file
based images since only the file name must be taken into account in this case. To improve
processing speed the usage of InsertImageEx() should be preferred.
Return values:
If the function succeeds the return value is the image handle, a value greater or equal zero. If the
function fails the return value is a negative error code.
Previous topic: Transparent images (Color Key Masking), Images with an alpha channel
Next topic: InsertMetafile, Bounding box check, How to calculate the image size?