Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 497

Previous Page 496   Index   Next Page 498

Function Reference
Page 497 of 750
UI32
NumComponents;
// Number of components (max 32)
TExtColorSpace CS;
// Image color space
SI32
CSHandle;
// Color space handle or -1
SI32
Stride;
// A negative value mirrors the image
LBOOL
HasAlpha;
// The image has an alpha channel?
LBOOL
IsBGR;
// Windows bitmap format?
LBOOL
MinIsWhite;
// 1 bit images only
UI32
Width;
// Width in pixels
UI32
Height;
// 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
image data.
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
SetTransparentColor()).
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: IsBidiText