VpePictureExport

<< Click to Display Table of Contents >>

Navigation:  Picture Export >

VpePictureExport

Previous pageReturn to chapter overviewNext page

[Windows platform only, Professional Edition and above]

Exports a rectangular part specified by x, y, x2, y2 of the page specified in parameter "page_no" to file. The settings for the export options of the specific file type, PictureExportColorDepth and PictureExportDither are used.

The type of image is automatically determined by the suffix of FileName (e.g. ".JPG" = JPEG). If FileName contains no suffix or a suffix which does not specify an image type (e.g. ".001"), the image type can be specified with the property PictureType. The resolution of the image is defined with VpeSetPictureDefaultDPI().

int VpePictureExport(

VpeHandle hDoc,

LPCSTR file_name,

int page_no,

VpeCoord x,

VpeCoord y,

VpeCoord x2,

VpeCoord y2

)

VpeHandle hDoc

Document Handle

LPCSTR file_name

(path- and) filename of exported image

int page_no

page number of the page that shall be exported from the document

VpeCoord x, y, x2, y2

rectangle of the page in metric or inch units that shall be exported as image

Returns:

Value

Description

True

success

False

failure

Remarks:

In case of an error, LastError is set.

 

During export, the BusyProgressBar is shown.

 

For x, y, x2, y2 you can also specify the V-Flags and for x2, y2 negative values to specify a delta value instead of an absolute coordinate.

 

The higher the color depth and the higher the resolution, the more memory is needed during export to create the image.

 

Metafiles are only supported on the Windows platform. The color depth and resolution can not be specified for metafiles (WMF / EMF), metafiles are always exported in true-color with a resolution of 600 x 600 DPI. The maximum dimensions for exported WMF is limited to 60 x 60 cm, this does not apply to EMF.

Example:

VpeSetPictureExportColorDepth(hDoc, PICEXP_COLOR_256)

VpeSetPictureExportDither(hDoc, PICEXP_DITHER_MONO)

SetPictureDefaultDPI(hDoc, 300, 300)

VpePictureExport(hDoc, "test.bmp", 1, 1, 1, -5, -5)

Instructs VPE to generate from the rectangle (1, 1, 6, 6) from page one of the document internally a 256 color image with 300 x 300 DPI resolution first, and to dither it down afterwards to b/w (monochrome) in the same 300 x 300 DPI resolution when writing it to the BMP file named "test.bmp".

 

VpePictureExport(hDoc, "test.bmp", 1, VLEFT, VTOP, VRIGHT, VBOTTOM)

Instructs VPE to export the last inserted object to an image file.

 

See also:

VpePictureExportStream