PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllInserts an image using the memory handle into a PDF document and returns the index of the image. compressionType is used to set up the inserted image compression.
|
| LONG AddImageFromBitmapHandle ( OLE_HANDLE handle, TxImageCompressionType compressionType ) |
Parameters
handle
Handle to an image object to insert.
compressionType
Image compression type.
Return value
New image index. If there is more then one image in a buffer then method returns index of a last added image.
Remarks
The return value is an image identifier in document's images collection and can be used in FlipImage, GetImageHeight, GetImageResolution, GetImageWidth, MakeImageGrayScale, MakeImageNegative, PlaceImageToCurrentPage, PDFPAGE_ShowImage.
Analogue in new interface: IPDFDocument4::AddImageFromHandle.
Example
How to insert and show an image in PDF
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
j := PDF.AddImageFromBitmapHandle(Img_HDC, itcJpeg);
PDF.PDFPAGE_ShowImage(j, 5, 5, 255, 368, 0);
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created PDF->BeginDoc(); LONG j = PDF->AddImageFromBitmapHandle(Img_HDC, itcJpeg); PDF->PDFPAGE_ShowImage(j, 5, 5, 255, 368, 0); PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created PDF.BeginDoc(); long j = PDF.AddImageFromBitmapHandle(Img_HDC, TxImageCompressionType.itcJpeg); PDF.PDFPAGE_ShowImage(j, 5, 5, 255, 368, 0); PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created PDF.BeginDoc j = PDF.AddImageFromBitmapHandle(Img_HDC, itcJpeg) PDF.PDFPAGE_ShowImage j, 5, 5, 255, 368, 0 PDF.EndDoc
See Also


