Up one HP-GL Viewer. By Lee Davison. Up to top

Introduction. Example output
    shuttle.plt

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.

Features.

  • 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.
  • Use. Example output
      atest.plt

    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 ..

    KeyFunction
    HomeMoves the viewpoint fully out and centres it.
    Page upMoves the viewpoint out.
    Page downMoves the viewpoint in.
    EndMoves the viewpoint fully in.
    Cursor rightPans the viewpoint right.
    Cursor leftPans the viewpoint left.
    Cursor upPans the viewpoint up.
    Cursor downPans the viewpoint down.
    SSaves the current view as "filename".bmp
    At any time use ESCAPE to quit.

    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.
  • View v2.08 or download the v2.08 source Download
  • Download the v2.08 DOS executable Download
  • Download some example hpgl files Download
  • Soft clip window.
  • Input window.
  • Scale and rotate.
  • Text scale and rotate.
  • Filled shapes.
  • Example output
      perp.plt Example output
      atoz.plt


    Last page update: 24th February, 2007. e-mail me e-mail