HTBasic Help
×
Menu
Index

Graphic Output

 
HTBasic graphic output drivers include: "WIN" (the default Windows Display Driver), "HPGL" (Hewlett-Packard Graphic Language) devices, and "PS" (Postscript printers, plotters and files), and "INTERNAL" (reuse last display driver). Note that HPGL is more specific to plotters, whereas PCL (HP's Printer Control Language) is a version of HPGL for printers.
 

PLOTTER IS vs DUMP DEVICE IS

The PLOTTER IS device outputs vector graphics to the specified device or file. CRT is the default PLOTTER IS device.
The DUMP DEVICE IS device outputs bit-mapped graphics from the screen to a device or file (a screen dump).
 

Driver Loading

Sample syntax of the PLOTTER IS statement for graphic drivers:
 
PLOTTER IS device-file, driver[,hard-clip] [; APPEND ]
PLOTTER IS device-file, driver[; COLOR MAP ]
 
Where:
device-file = ISC (interface select code) or CRT, or "file-name"
driver =  driver name as string value [with options] or the constant "INTERNAL" which means the last CRT driver specified.
 
Example: 
 
PLOTTER IS CRT,"INTERNAL";COLOR MAP
 
The output of a graphic driver can be a device or file, depending on output type. For example, GIF output can only go to a file.
The driver name ("HPGL", "PS", "WIN"), can optionally include a semicolon and any options.
 
Hard-clip is composed of four values (xmin, xmax, ymin and ymax) that specify the size of the drawing surface. For example:
 
PLOTTER IS 10,"HPGL",2,268,0,190
PLOTTER IS "Pictfile","HPGL",5.75,250.50,7.25,136.875 
 
PLOTTER IS assignments can be included in your AUTOST file. Up to ten graphic and dump drivers can be loaded at a time.
 
To find the named driver file, such as in PLOTTER IS 10,"HPGL", HTBasic appends ".DW6" (i.e. HPGL.DW6), if necessary, and then searches the following locations:
 
1.  The directory containing the HTBasic executable.
2.  The current directory.
3.  The Windows system directory (such as \WINDOWS\SYSTEM).
4.  The Windows directory.
5.  The directories listed in the PATH environment variable.
 

CRT Driver

WIN is the default driver loaded when HTBasic  starts.
 

Output to a Device

To send vector graphics to a plotter or printer, specify its ISC (interface select code), or use the device-selector if it's on the IEEE-488 GPIB bus.
 
Hard-clip limits (if specified) are given as xmin, xmax, ymin, ymax in millimeters.
 
If the hard-clip limits are not specified, they are read from the device when PLOTTER IS is executed. The specified device must respond to this query or the computer will wait indefinitely for the response. Use the CLR-I/O key to clear the computer if it gets stuck in this state.
 
The following example sends HPGL commands to a compatible printer at ISC 26. The first line resets the printer, starts landscape printing and switches into HPGL mode. The second line directs vector output to the printer and sets the hard-clip units for an 8-1/2 x 11 sheet of paper.
 
OUTPUT 26;CHR$(27)&"E"&CHR$(27)&"&l1O"&CHR$(27)&"%1B";
PLOTTER IS 26,"HPGL",2,268,0,190 
 

Output to a File

To send graphics output to a file, destination should be replaced with the file name. The file must be an existing file. The hard-clip limits may be specified or defaulted to ±392.75 mm on the x axis and ±251.5 mm on the y axis. If APPEND is not specified, the file is positioned to the beginning and truncated. The file is closed when another PLOTTER IS, GINIT or SCRATCH A statement is executed. For example:
 
CREATE "DRAW.PLT",0
PLOTTER IS "DRAW.PLT","HPGL"
 

WIN Driver

The WIN driver is a CRT driver that uses the Microsoft Windows display drivers.
 
Switch
Effect
-fn        
Use named font
-geometry
Specify initial size of HTBasic window
-title        
Specify the window title
 
 

Manual Window Resizing

Using the mouse to manually resize the Run window has the following unfortunate side effects: any displayed text or graphics is lost and the current pen position is left undefined while the VIEWPORT, WINDOW and hard clip limits are unchanged. You can use GESCAPE CRT,3 to get the new window size and you can use the GINIT statement to set the VIEWPORT, WINDOW and hard clip limits to the new window size, or you can activate use of the new hard clip limits without the side effects of GINIT with:
 
PLOTTER IS CRT,"INTERNAL"