<< Click to Display Table of Contents >> VpeRenderPicture |
Computes the dimensions of a given image, based on the method VpePicture(). The dimensions are computed including the surrounding frame, if PenSize is <> 0.
If the property PictureCache is true, the rendered image will automatically be stored in the image cache. We recommend to set PictureCache = true always.
void VpeRenderPicture(
VpeHandle hDoc,
VpeCoord width,
VpeCoord height,
LPCTSTR file_name
)
VpeHandle hDoc
Document Handle
VpeCoord width, height
Can be used to compute either the width or the height by setting one value to a numeric value whilst using VFREE for the other value. Usually you will set both values to VFREE.
LPCSTR file_name
the image file to be rendered
Remarks:
In case of an error, LastError is set.
The computed dimensions can be retrieved with
VpeGet(hDoc, VRENDERWIDTH)
VpeGet(hDoc, VRENDERHEIGHT)
Rendering a picture will move the picture to the image cache (if VpeSetPictureCache() has been set to true before).
Example:
VpeSetPictureCache(hDoc, TRUE);
VpeRenderPicture(hDoc, VFREE, VFREE, "image.bmp")
xsize = VpeGet(hDoc, VRENDERWIDTH)
ysize = VpeGet(hDoc, VRENDERHEIGHT)
Computes the width and height of the image stored in "image.bmp". By setting PictureCache to true, the image will be loaded into the cache, so if you insert the image later into a document, it isn’t loaded from file a second time (assuming, that it isn’t flushed from the cache, because you rendered / inserted many other - or huge - images that needed the cache). PictureCache is by default true when you open a document.
VpeSetPictureKeepAspect(hDoc, TRUE)
VpeRenderPicture(hDoc, VFREE, 5, "image.bmp")
xsize = VpeGet(hDoc, VRENDERWIDTH)
Computes the undistorted width of the image stored in "image.bmp" relative to the given height of 5cm.
"Rendering Objects" in the Programmer's Manual