DynaPDF Manual - Page 545
Previous Page 544 Index Next Page 546
Page 545 of 821
// Color space handle or -1
// A negative value mirrors the image
// The image has an alpha channel?
// Windows bitmap format?
// 1 bit images only
// Width in pixels
// Height in pixels
The function inserts an image from a raw image buffer that contains no image header. Unlike
InsertRawImage() the function supports also multi-channel images with less than 8 bits per
component as well as arbitrary aligned scanlines.
Images with 1, 2, 4, 8, and 16 bits per component are supported. 2 and 4 bits per component images
can be used with Indexed and DeviceN color spaces. The corresponding color space must be created
beforehand and the color space handle must be set to CSHandle. No color table must precede the
1 bit images with only one component are treated as an image mask if SetUseTransparency() is set to
true (default) and if the color space of the image is set to esDeviceGray. An image mask is drawn
with the current fill color. Zero pixel values produce no output.
Images with 8 bits per component can contain an alpha channel. The parameter HasAlpha must be
set to true in this case and the alpha channel must be assigned to the last component. The image can
contain up to 32 components including the alpha channel.
If the alpha channel is stored in a separate image buffer then use AddMaskImage() to add the alpha
channel. The function supports also the creation of a 1 bit image mask.
The scanline length (Stride) can be a positve or negative value. If negative, the image is read from
bottom to top.
If IsBGR is true and if the color space is set to esDeviceRGB, the color components are interpreted in
BGR order. This component order is mainly used in Windows Bitmaps.
If MinIsWhite is set to true, zero pixel values are interpreted as white. This parameter applies only to
images with 1 bit per component.
The function does not use the active color space and it performs no color conversion.
Color Key Masking
Images which use a device color space are treated as usual. That means, if SetUseTransparency() is
set to true (default), then the image is masked with the current transparent color (see
Images of other color spaces can be masked too with SetColorMask(). Color key masking depends
on exact color values. To avoid issues due to color interpolation the image should be compressed
with Flate encoding. See SetCompressionFilter() for further information.
Previous topic: InsertRawImageEx
Next topic: How to calculate the image size?, IsBidiText, IsColorPage