When an application associates a presentation space with a device context, a default device transformation is set. A page viewport is defined according to the rules in the following table:

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Presentation-page ³Page viewport size  ³Usage.                ³
³specification     ³                    ³                      ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³Pels              ³The same size as the³The lower-left corner ³
³                  ³presentation page.  ³of the presentation   ³
³                  ³                    ³page maps to the      ³
³                  ³                    ³lower-left corner of  ³
³                  ³                    ³the device space. For ³
³                  ³                    ³example, if an        ³
³                  ³                    ³application defines a ³
³                  ³                    ³presentation page of  ³
³                  ³                    ³300 coordinates       ³
³                  ³                    ³(x-axis)-by-200       ³
³                  ³                    ³coordinates (y-axis), ³
³                  ³                    ³then the picture is   ³
³                  ³                    ³transformed to a      ³
³                  ³                    ³screen area of the    ³
³                  ³                    ³same size.            ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³Metric units      ³The coordinates that³The lower-left corner ³
³                  ³produce the correct ³of the presentation   ³
³                  ³matrix for the      ³page maps to the      ³
³                  ³physical spacing of ³lower-left corner of  ³
³                  ³the pels.           ³the device space.     ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³Arbitrary units   ³The default size for³The page viewport is  ³
³                  ³the device is used. ³constructed such that ³
³                  ³For a plotter or    ³the presentation-page ³
³                  ³printer, this is the³coordinates give equal³
³                  ³maximum accessible  ³x- and y-spacing. The ³
³                  ³area of the paper,  ³lower-left corner of  ³
³                  ³and for a screen, it³the presentation page ³
³                  ³is the maximized    ³maps to the lower-left³
³                  ³window size.        ³corner of the device  ³
³                  ³                    ³space, and either the ³
³                  ³                    ³right or the top edges³
³                  ³                    ³map, such that the    ³
³                  ³                    ³picture is contained  ³
³                  ³                    ³within the device     ³
³                  ³                    ³rectangle and its     ³
³                  ³                    ³aspect ratio is       ³
³                  ³                    ³preserved.            ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
The following figure shows mapping from the presentation page to the device.

The device transformation can be explicitly specified using GpiSetPageViewport.

Mapping a Picture from the Presentation Page to the Device

In this example, a map of the world has been drawn in a presentation page, defined in arbitrary units, that is much larger than the device space. The device transformation scales the picture to fit the maximized window size and preserves its aspect ratio.


[Back] [Next]