DynaPDF Manual - Page 684

Previous Page 683   Index   Next Page 685

Function Reference
Page 684 of 860
The resolution, aspect ratio, color space and so on can be freely chosen. However, note that this
function does not change the output position or size. If the aspect ratio of the new image is different,
then it will be stretched or shrunk to fit into the output rectangle.
The parameter CS specifies the destination color space into which the image should be converted or
saved, if the image is already defined in that color space. CSHandle must be the handle of that color
space if a non-device space is used. The will be ignored for devices spaces.
The function works in the very same way as InsertImageEx() with the following differences:
The color of an image mask cannot be set or changed because this would require changes on
the content stream in which the image is used. An image mask will be created if the image
color depth is 1 bit and if color key masking is enabled (see SetUseTransparency()).
SetUseTransparency() should normally be set to false before calling this function.
The image will never be downscaled, independent of the current resolution, because the size
of the output rectangle is not known.
If the image that should be replaced is a soft mask of another base image, then make sure that the
destination color space is set to esDeviceGray, CalGray, or to a one channel ICC based color space
because a soft mask must not contain more than one color channel.
The flags gfUseImageColorSpace, gfIgnoreICCProfiles, gfRealPassThrough, and gfNoBitmapAlpha
are all supported. See SetGStateFlags() for further information.
Remarks:
This function is implemented in an Ansi and Unicode compatible version. Unicode paths are
converted to UTF-8 on non-Windows operating systems.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
ReplaceImageEx
Syntax:
LBOOL pdfReplaceImageEx(
const PPDF* IPDF,
// Instance pointer
const PIMG* Source,
// Pointer of the image object
const void* Buffer,
// Pointer to image buffer
UI32 BufSize,
// Buffer size in bytes
UI32 Index,
// The first image is denoted by 1
TExtColorSpace CS,
// Image color space
SI32 CSHandle,
// Color space handle or -1 for device spaces
TReplaceImageFlags Flags) // See below.
The function replaces an image with a new image exactly like ReplaceImage() but accepts a file
buffer as input. See ReplaceImage() for further information.
 

Previous topic: ReplaceICCProfileEx, ReplaceImage

Next topic: ReplacePageText