Components for Developers
© 2000-2008, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Images
AddImageWithColorMask

See Also Example
Collapse All

Inserts a masked image from a file into a PDF document's collection and returns the index of the image.

Syntax

LONG AddImageWithColorMask (
BSTR fileName,
OLE_COLOR rgbColor
)
Parameters
fileName
Path to the image file.

rgbColor
Color which marks points that need to be transparent.

Return value
New image index. If there is more then one image added then method returns index of a last added image.

Remarks

rgbColorparameter is a double word (4 bytes) value 0x00BBGGRR. The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero.

The return value is an image identifier in document's images collection and can be used in GetImageHeight, GetImageResolution, GetImageWidth, TransformImage, ShowImage, DrawImage.

Example

How to load image with color mask

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
clr := 255; { 255=x0000FF - red color }
ind := PDF.AddImageWithColorMask('picture.gif', clr);
PDF.ShowImage(ind, 0, 0);
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long clr = 255; //255=0x0000FF - red color
long ind = PDF->AddImageWithColorMask("picture.gif", clr);
PDF->ShowImage(ind, 0, 0);
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
long clr = 255; //255=0x0000FF - red color
long ind = PDF.AddImageWithColorMask("picture.gif", clr);
PDF.ShowImage(ind, 0, 0);
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
clr = 255 '255=0x0000FF - red color
ind = PDF.AddImageWithColorMask("picture.gif", clr)
PDF.ShowImage ind, 0, 0
PDF.SaveToFile "test.pdf", true

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2008, Two Pilots