HP-GL Viewer. By Lee Davison. |
Features.This HP-GL viewer is written in QuickBASIC 4.5 and can interpret most common HP-GL and some HP-GL2 drawing commands. QuickBASIC 4.5 was chosen purely because it's available on all the PCs I usually use. There is nothing particularly clever in the code and it should translate easily to any other language.
Use.
Most common line and curve commands. Shapes. Pen select. Text plotting. Autoscale for best fit to 640 x 480 screen. Zoom and pan the plotted image. Save the screen image as a .bmp file. Errrr. That's it.
There are no command line options, when the program is run it will prompt for a filename, this should be the full name and extension, if any, and does not need to be any particular file extension type.
The file will then be processed to determine the size of the plot and warnings or errors found, if there are any, will be reported and the program will wait for a key press before proceeding. Next the file will be processed again and this time any resulting output will be drawn to the screen.
New to version 2.xx is the ability to save the screem as a 640 x 480 .bmp file. This is done by pressing the S key which will create a .bmp file with the same name as the input file.
Once the plot is generated it can be zoomed out so it only fills one quater of the screen or zoomed in untill it either fills the screen is plotted at a scale of 1:1, whichever is the bigger image. The viewpoint can be panned left, right, up and down.
The keys are ..
At any time use ESCAPE to quit.
Key Function Home Moves the viewpoint fully out and centres it. Page up Moves the viewpoint out. Page down Moves the viewpoint in. End Moves the viewpoint fully in. Cursor right Pans the viewpoint right. Cursor left Pans the viewpoint left. Cursor up Pans the viewpoint up. Cursor down Pans the viewpoint down. S Saves the current view as "filename".bmp Limits are:-
You can't move out further than the plot image filling one quater of the screen. You can't move in any closer than a scale of 1:1. You can't pan beyond the edges of the plot image.
Software. | To do. | ||
|
|
Last page update: 24th February, 2007. | e-mail me |