PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllRetrieves width of an image with specified index.
|
| LONG GetImageWidth ( LONG imageIndex ) |
Parameters
imageIndex
Image index.
Return value
Image width.
Remarks
Image index can be retrieved from any image loading method, like AddImageFromFile.
Analogue in new interface: IPDFDocument4::GetImageWidth.
Example
How to get image dimensions
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
ind := PDF.AddImageFromFile('picture.gif');
w := PDF.GetImageWidth(ind);
h := PDF.GetImageHeight(ind);
PDF.PDFPAGE_ShowImage(ind, 10, 10, w, h, 0.0);
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
LONG ind = PDF->AddImageFromFile("picture.gif");
LONG w = PDF->GetImageWidth(ind);
LONG h = PDF->GetImageHeight(ind);
PDF->PDFPAGE_ShowImage(ind, 10, 10, w, h, 0.0);
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
long ind = PDF.AddImageFromFile("picture.gif");
long w = PDF.GetImageWidth(ind);
long h = PDF.GetImageHeight(ind);
PDF.PDFPAGE_ShowImage(ind, 10, 10, w, h, 0.0);
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc
ind = PDF.AddImageFromFile("picture.gif")
w = PDF.GetImageWidth(ind)
h = PDF.GetImageHeight(ind)
PDF.PDFPAGE_ShowImage ind, 10, 10, w, h, 0.0
PDF.EndDoc
See Also


