Setviewportorgex indicates the device point mapped to the window origin (0, 0)
Bool setviewportorgex (
HDC, // handle of the device content
Int X, // X coordinate of the new viewport
Int y, // y coordinate of the new viewport
Lppoint // coordinates of the original viewport
);
Parameters:
HDC: [input] Handle of device content
X: [input] x coordinate of the device unit of the new viewport Origin
Y: [input] Y coordinate of the device unit of the new viewport Origin
Lppoint:
[Output] points to a point structure to receive the coordinates of the original viewport origin. The coordinates are device units. If lppoint is null, this parameter is not used.
Return Value:
If the return result is successful, a value other than 0 is returned. If the return result fails, 0 is returned.
Note:
This function (along with setviewportextex and setw.wextex) helps define the logical coordinate space (that is, a window) to the device coordinate space ing (viewport ). Setviewportorgex specifies the device point mapped to the logical point (0, 0). It has the function of moving the coordinate axis, so that the logical point (0, 0) no longer points to the upper left corner.
// Map the logical point (0, 0) to the device point (xvieworg, yvieworg)
Setviewportorgex (HDC, xvieworg, yvieworg, null)
This is the role of setviewportorgex. In general, you use one function or another function, but you cannot use it all. Whether you use setjavasworgex or setviewportorgex, the device point () is always in the upper left corner.