GetImageHeight
IPDFDocument3 :: General document methods

See Also Example
Collapse All

This method retrieves the height of the image with the specified index.

Syntax

LONG GetImageHeight (
LONG imageIndex
)
Parameters
imageIndex
Index of the image

Return value
Height of the specified image

Remarks

The index of the image can be retrieved from any image loading method, such as AddImageFromFile.

Equivalent in new interface: IPDFDocument4::GetImageHeight.

Example

How to Get the Dimensions of an Image

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

Reference