73.1.3 The Default Transformations

Whenever an application creates a device context and immediately begins calling GDI drawing or output functions, it takes advantage of the default world- to page-space, page- to device-space, and device-space to client-area transformations.

The default world- to page-space transformation is represented by the identity matrix:

|1 0 0|

|0 1 0|

|0 0 1|

The identity matrix results in a one-to-one mapping from world-space to page-space. This means that a rectangle that a given point in world space maps to the same point in page space—there is no translation, scaling, rotation, shear, or reflection.

The default page- to device-space transformation also results in a one-to-one mapping. As previously mentioned, this transformation is not specified by a matrix—it is obtained by dividing the width of the viewport by the width of the window and the height of the viewport by the height of the window. In the default case, the viewport dimensions are 1 pixel by 1 pixel and the window dimensions are 1 page unit by 1 page unit.

The device-space to client-area (or desktop, or printer paper) transformation always results in a one-to-one mapping. This means that one unit in device space will always be equivalent to one unit in the client area, on the desktop, or on a page of printer paper. (The sole purpose of this transformation is translation—it ensures that output will appear correctly in an application's window no matter where that window is moved on the desktop.)

The one unique aspect of the default transformation is the orientation of the y-axis in device space and the client area of the application's window. In the default case, the positive y-axis extends downward and the negative y-axis extends upward.