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

Page Viewport Device Transform

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

Page Viewport Device Transform

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


[Back: GreSetPageUnits - Parameters]
[Next: GreSetPageUnits - Topics]