GDDM V3R2 Base Application Programming Guide
|
Previous topic |
Next topic |
Contents |
Index |
Contact z/OS |
Library |
PDF |
BOOK
Plotting to scale GDDM V3R2 Base Application Programming Guide SC33-0867-01 |
|
You may need to plot your program's output at a specific size. You can do this by making each window (world-coordinate) unit represent a particular physical measurement in the plotted output. The programming example in Figure 117 makes one window unit plot as one millimeter, and then draws a 100-millimeter square. To define the window units as required, you need to query three things: the number of rows and columns of notional cells in the current graphics field, the number of plotter units per cell in each direction, and the density of plotter units (or resolution) in both directions. This information is obtained at C and E . The subsequent statements show how to calculate the number of window units to make one unit equal to one millimeter when plotted. The calculations multiply the number of rows and columns by the depth and width of a cell in plotter units to obtain the depth and width of the graphics field in plotter units. This value is divided by the number of plotter units per meter, and multiplied by 1000 to convert meters to millimeters. Before the device can be queried, it must be opened, as at A . It is then made current, at B . Before the graphics field can be queried, it must be created. The example forces the creation of a default graphics field by issuing a graphics primitive call (GSMOVE at D ). Another way that the program could create the same graphics field is by explicitly using a GSFLD call, specifying the page size as returned in QDEV(3) and QDEV(4). The statements D and E would be replaced by the following lines:
ROWS = QDEV(3);
COLS = QDEV(4);
CALL GSFLD(1,1,ROWS,COLS);
After the required graphics window has been created at F , a square of
100 window units is drawn. When plotted following the FSFRCE call at G ,
it is 100-millimeters square.
|
Copyright IBM Corporation 1990, 2012 |