NAME:
  tvgrab
 PURPOSE:   (one line only)
  Grab plot window and save to a portable image file.
 DESCRIPTION:
 CATEGORY:
  File I/O
 CALLING SEQUENCE:
  tvgrab,fn,win
 INPUTS:
  fn  - file name for output JPG file
  win - window number to grab and save
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
  PNG - flag, if set saves image in PNG format, otherwise saved as JPG
  TIFF - flaf, if set save image in TIFF format, otherwise saved as JPG
 OUTPUTS:
 KEYWORD OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
  Written by Marc W. Buie, Lowell Observatory, 2002/10/04
  2005/07/27, MWB, added PNG keyword
  2010/02/01, MWB, added TIFF keyword
  2010/06/23, MWB, changed setwin call to wset
  2017/07/05, MWB, added support for !order