This method inserts an image from a file into a PDF document and returns the index of the image. You can specify a color which will be masked (made transparent) in the image.
LONG AddImageWithColorMask ( BSTR fileName, OLE_COLOR colorMask ) |
The return value is an image identifier in the document's images collection and can be used in FlipImage, GetImageHeight, GetImageResolution, GetImageWidth, MakeImageGrayScale, MakeImageNegative, PlaceImageToCurrentPage, PDFPAGE_ShowImage.
Equivalent in new interface: IPDFDocument4::AddImageWithColorMask.
{ PDF object is supposed to be created } PDF.BeginDoc; clr := 255; { 255=x0000FF - red color } j := PDF.AddImageWithColorMask('picture.gif', clr); PDF.PDFPAGE_ShowImage(j, 0, 0, 122, 89, 0); PDF.EndDoc;
// PDF object is supposed to be created PDF->BeginDoc(); COLORREF clr = RGB(0xFF, 0, 0); // red color LONG j = PDF->AddImageWithColorMask("picture.gif", clr); PDF->PDFPAGE_ShowImage(j, 0, 0, 122, 89, 0); PDF->EndDoc();
// PDF object is supposed to be created PDF.BeginDoc(); int clr = System.Drawing.ColorTranslator.ToWin32(Color.Red); long j = PDF.AddImageWithColorMask("picture.gif", clr); PDF.PDFPAGE_ShowImage(j, 0, 0, 122, 89, 0); PDF.EndDoc();
' PDF object is supposed to be created PDF.BeginDoc clr = 255 '255=0x0000FF - red color j = PDF.AddImageWithColorMask("picture.gif", clr) PDF.PDFPAGE_ShowImage j, 0, 0, 122, 89, 0 PDF.EndDoc