The Coordinate System

The default coordinate system for a display context is very simple. The upper-left corner of the client area is the origin, or point (0, 0). Each pixel to the right represents one unit along the positive x-axis. Each pixel down represents one unit along the positive y-axis.

You can modify this coordinate system by changing the mapping mode and display origins. The mapping mode defines the coordinate-system units. The default mode is MM_TEXT, or one pixel per unit. You can also specify mapping modes that use inches or millimeters as units. The SetMapMode function changes the mapping mode for a device. The origin of the coordinate system can be moved to any point by calling the SetViewportOrg function.

For simplicity, the examples in this chapter and throughout this guide use the default coordinate system.