DrawImage
IPDFDocument4 :: Page Operations :: Graphics

See Also
Collapse All

This method draws an image in a PDF document.

Syntax

HRESULT DrawImage (
LONG imageNumber,
FLOAT left,
FLOAT top,
FLOAT width,
FLOAT height,
FLOAT angle
)
Parameters
imageNumber
Number of an image in the document's images collection

left
X coordinate of the location of the image

top
Y coordinate of the location of the image

width
Width of the image

height
Height of the image

angle
Angle of rotation

Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Remarks

This method places the image data into the current content stream for the page. The image will appear in the specified size (width, height) with one corner at (left, top) and will be rotated to the specified angle (in degrees). Positive values indicate counterclockwise rotation.

Use the ShowImage method if you want to draw an unscaled image.

imageIndex is returned by any image loading method, such as AddImageFromFile.

See the PageResolution property for examples.

See Also

Reference