BOOL SetWorldTransform(hdc, lpXform) | |||||
HDC hdc; | /* handle of device context | */ | |||
LPXFORM lpXform; | /* address of transformation data | */ |
The SetWorldTransform function sets a 2-dimensional linear transformation between world space and page space for the given device-context. This transformation can be used to scale, rotate, shear, or translate graphic output.
hdc
Identifies the device context.
lpXform
Points to an XFORM structure that contains the transformation data. The XFORM structure has the following format:
typedef struct tagXFORM /* xfrm */
{ FLOAT eM11;
FLOAT eM12;
FLOAT eM21;
FLOAT eM22;
FLOAT eDx;
FLOAT eDy;
} XFORM, *PXFORM, FAR *LPXFORM;
The return value is TRUE if the function succeeds, otherwise it is FALSE.
For any coordinates (x, y) in world space the transformed coordinates in page space (x', y') can be determined by the following:
x' = x * eM11 + y * eM21 + eDx,
y' = x * eM12 + y * eM22 + eDy,
where the transformation matrix is represented by:
| eM11 eM12 0 |
| eM21 eM22 0 |
| eDx eDy 1 |
The mapping mode and window-viewport serve to define units and scales.
The world transformation is normally used to scale or rotate logical images in a device independent way.
The default world transformation is the identity matrix with zero offset.
SetMapMode, SetWindowOrgEx, SetWindowExtEx, SetViewportOrgEx, SetViewportExtEx, GetWorldTransform, ModifyWorldTransform