Microsoft KB Archive/66119

INF: Implementing Customized Coordinate System in PM PSS ID Number: Q66119 Article last modified on 09-06-1991 PSS database name: P_PresMan

1.21

OS/2

Summary:

The following information describes how to change the coordinate origins and the coordinate units to draw points or lines, without transposing the values for the coordinate system.

First of all, the programmer must set the overall size that they want in a SIZEL structure and call GpiSetPS with both the SIZEL structure that was just set and with PU_ARBITRARY. Then, a RECTL structure should be set with the modified set of coordinates. For example:

rect.xLeft = The width of the window / 2 rect.yBottom = The height of the window /2 rect.xRight = rect.xLeft + the width of the window rect.yTop = rect.yBottom + the height of the window

Finally, GpiSetPageViewport(hps, &rect) should be called. This method still allows transform matrixes to be used to modify images.

In the Software/Data Library, is a file named TRMATRIX that includes a small sample program to demonstrate how this functionality can be implemented. The sample program displays an “X” at 0,0, which is in the middle of the screen [there is an extended leg of the “X” that shows the (+,+) coordinate space].

TRMATRIX can be found in the Software/Data Library by searching on the word TRMATRIX, the Q number of this article, or S12723. TRMATRIX was archived using the PKware file-compression utility.

Copyright Microsoft Corporation 1991.