## Presentation Device Driver Reference for OS/2

[prev][next][parent][TOC]

### GreSetPageUnits - Remarks

This function causes the Window/Viewport Transform, Page Viewport, and Device Transform matrixes to be updated as shown below. For PU_LOMETRIC, PU _HIMETRIC, PU_TWIPS, PU_LOENGLISH, PU_HIENGLISH, and PU_PELS:

Window/Viewport Transform Unity
Page Viewport (0,0) (sx*lWidth-1, sy*lHeight-1)
Device Transform As defined by the mapping from Page Window to Page Viewport

Where "sx" is the horizontal scaling required by page units for the device (or 1 for PU_PELS), and "sy" is the vertical scaling required by page units for the device (or 1 for PU_PELS).

For PU_ARBITRARY:

Window/Viewport Transform Unity
Page Viewport (0,0) (X2,Y2)
Device Transform As defined by the mapping from Page Window to Page Viewport

Where "Dh" is the default device (maximized window) height in pels, "Dw" is the default device (maximized window) width in pels, and "Par" is the pel ( width/height) aspect ratio. X2 and Y2 are integers, determined as follows:

         When (lWidth/lHeight) > Par*(Dw/Dh):

               X2 = Dw-1

               Y2 = Par*Dw * (lWidth/lHeight)-1

         When (lWidth/lHeight) < Par*(Dw/Dh):

               X2 = (1/Par) * Dh * (lWidth/lHeight)-1

               Y2 = Dh-1

         Otherwise, when (lWidth/lHeight) = Par*(Dw/Dh):

               X2 = Dw-1

               Y2 = Dh-1