<< Click to Display Table of Contents >> VpeGet |
Returns the coordinate / value specified by one of the V-Flags provided in parameter "what". See "Dynamic Positioning" in the Programmer's Manual for details.
VpeCoord VpeGet(
VpeHandle hDoc,
VpeCoord what
)
VpeHandle hDoc
Document Handle
VpeCoord what
one of the following V-Flags:
Constant Name |
Value |
VLEFT |
-2147483550 |
VRIGHT |
-2147483551 |
VLEFTMARGIN |
-2147483552 |
VRIGHTMARGIN |
-2147483553 |
VTOP |
-2147483554 |
VBOTTOM |
-2147483555 |
VTOPMARGIN |
-2147483556 |
VBOTTOMMARGIN |
-2147483557 |
|
|
VWIDTH |
-100 |
VHEIGHT |
-101 |
VRENDERWIDTH |
-102 |
VRENDERHEIGHT |
-103 |
|
|
VUDO_LEFT |
-104 |
VUDO_RIGHT |
-105 |
VUDO_TOP |
-106 |
VUDO_BOTTOM |
-107 |
VUDO_WIDTH |
-108 |
VUDO_HEIGHT |
-109 |
Returns:
The coordinate / value specified by parameter "what"
Remarks:
In contrast to the other V-Flags, the VUDO_xyz Flags return the bounding rectangle of the UDO in DEVICE COORDINATES (!) (not in metric or inch units).
Note: the values for margins are specified in coordinates relative to the top / left paper border, e.g. if the right margin shall be 2cm away from the right paper border, set it to ‘page_width - 2’. If you would set the right margin = 2, it would be 2cm away from the left border.
For use with C/C++ there are macros defined in VPECOMON.H, which are easier to use:
#define nLeft(hDoc) VpeGet(hDoc, VLEFT)
#define nTop(hDoc) VpeGet(hDoc, VTOP)
#define nRight(hDoc) VpeGet(hDoc, VRIGHT)
#define nBottom(hDoc) VpeGet(hDoc, VBOTTOM)
#define nLeftMargin(hDoc) VpeGet(hDoc, VLEFTMARGIN)
#define nTopMargin(hDoc) VpeGet(hDoc, VTOPMARGIN)
#define nRightMargin(hDoc) VpeGet(hDoc, VRIGHTMARGIN)
#define nBottomMargin(hDoc) VpeGet(hDoc, VBOTTOMMARGIN)
#define nWidth(hDoc) VpeGet(hDoc, VWIDTH)
#define nHeight(hDoc) VpeGet(hDoc, VHEIGHT)
#define nRenderWidth(hDoc) VpeGet(hDoc, VRENDERWIDTH)
#define nRenderHeight(hDoc) VpeGet(hDoc, VRENDERHEIGHT)
#define nUDOLeft(hDoc) VpeGet(hDoc, VUDO_LEFT)
#define nUDORight(hDoc) VpeGet(hDoc, VUDO_RIGHT)
#define nUDOTop(hDoc) VpeGet(hDoc, VUDO_TOP)
#define nUDOBottom(hDoc) VpeGet(hDoc, VUDO_BOTTOM)
#define nUDOWidth(hDoc) VpeGet(hDoc, VUDO_WIDTH)
#define nUDOHeight(hDoc) VpeGet(hDoc, VUDO_HEIGHT)
Example:
VpeWrite(hDoc, 1, 2, 4, 3, "Hello")
After executing this method the properties contain the following values:
VLEFT = 1, VTOP = 2, VRIGHT = 4, VBOTTOM = 3
You can insert an object at the right border of the last inserted object with:
VpePrint(hDoc, VpeGet(hDoc, VRIGHT), VpeGet(hDoc, VTOP), " World!")
The equal result (but with faster processing) is created with the following statement:
VpePrint(hDoc, VRIGHT, VTOP, " World!")
If you want to insert the second object with an offset, you can only use:
VpePrint(hDoc, VpeGet(hDoc, VRIGHT) + 0.5, VpeGet(hDoc, VTOP), " World!")
which will insert the object with an offset of 0.5 cm to the right border of the previously inserted object.
The following is not possible:
VpePrint(hDoc, VRIGHT + 0.5, VTOP, " World!")
because VRIGHT is a constant (its value is -2147483551), which instructs VPE to retrieve the value of the property RIGHT internally. If you add 0.5, the result is -2147483550.5, which is interpreted as a standard coordinate.