<< Click to Display Table of Contents >> VpeSetPictureKeepAspect |
Setting this mode on/off determines whether a scaled picture shall be distorted or not, when the x OR y dimension is calculated automatically. This makes sense, if only ONE parameter of a Picture-Method is VFREE: x2 OR y2. If both are VFREE, the image is always undistorted.
void VpeSetPictureKeepAspect(
VpeHandle hDoc,
int on_off
)
VpeHandle hDoc
Document Handle or VPE Object Handle
int on_off
Value |
Description |
True |
on (pictures will be scaled undistorted) |
False |
Off |
Default:
True
Example:
VpeSetPictureKeepAspect(hDoc, TRUE)
VpePicture(hDoc, 1, 1, -5, VFREE, "image1.tif")
In the example, the width of the image will be 5cm. If the image had an original size of 15 x 21 cm, the width is now 1/3 of the original size. Because PictureKeepAspect is True, VPE will compute the height to the same aspect ratio = 1/3 of the original height, which would then be 7 cm.
Note: the above example assumes that the resolution of the image is the same for the width and the height. Otherwise the computations performed by VPE are slightly more difficult.
"Pictures" in the Programmer's Manual