!   TITLE:  tv_create_image.mac (MANAGEMENT)
!
!
!   TOOLBAR VERSION
!
!   OBJECTIVE:
!
!   This sub-macro creates a graphics image file of the currently displayed
!   ANSYS graphics window.
!
!
!   ARGUMENTS:
!
!       (1) imgtyp = image format type: Valid inputs are:
!
!               'pscr' - encapsulated postscript (EPS)
!
!               'tiff' - tagged image file format (default)
!
!               'epsi' - encapsulated postscript with TIFF preview
!
!               'bmp' - bitmap ( PC only )
!
!               'wmf' - windows metafile format ( PC only )
!
!               'emf' - enhanced metafile format ( PC only )
!
!               'jpeg' - Joint Photographic Expert Group format
!
!       (2) orient = image orientation on the page
!
!               0 = landscape (default)
!
!               1 = portrait
!
!       (3) revrs = reverse video background ( print background )
!
!               0 = reverse video background ( white vackground ) (default)
!
!               1 = normal ( black background )
!
!       (4) colr = color of image
!
!               0 = color print ( at specified color depth ) (default)
!
!               1 = black and white
!
!               2 = greyscale
!
!
!   DESCRIPTION:
!
!   This macro creates a graphics file of the current output window in the
!   specified graphics format. If the image is a TIFF or EPS format, then
!   it compresses the file. The ANSYS /UI commmand is used to perform this
!   function.
!
!
!
!
*get,prkey_,active,0,prkey
/nopr

multipro,'start',4
    *cset,1,3,imgtyp_,'Image Type',2
    *cset,4,6,orient_,'0=Landscape, 1=Portrait',0
    *cset,7,9,revrs_,'0=White, 1=Black Background',0
    *cset,10,12,colr_,'0=Color, 1=Black/White, 2=GryScl',0
    *cset,61,62,'Creates a graphics file. Image',' types: 1=PSCR, 2=TIFF,'
    *cset,63,64,'3=EPSI, 4=BMP, 5=WMF, 6=EMF, 7=','JPEG. Enter data.'
multipro,'end'
!
*if,imgtyp_,eq,1,then
    imgtyp_='pscr'
*elseif,imgtyp_,eq,2,then
    imgtyp_='tiff'
*elseif,imgtyp_,eq,3,then
    imgtyp_='epsi'
*elseif,imgtyp_,eq,4,then
    imgtyp_='bmp'
*elseif,imgtyp_,eq,5,then
    imgtyp_='wmf'
*elseif,imgtyp_,eq,6,then
    imgtyp_='emf'
*elseif,imgtyp_,eq,7,then
    imgtyp_='jpeg'
*endif
!
*if,orient_,eq,0,then
    orient_='landscape'
*elseif,orient_,eq,1,then
    orient_='portrait'
*endif
!
*if,revrs_,eq,0,then
    revrs_='reverse'
*elseif,revrs_,eq,1,then
    revrs_='norm'
*endif
!
*if,colr_,eq,1,then
    colr_='mono'
*elseif,colr_,eq,2,then
    colr_='grey'
*elseif,colr_,eq,0,then
    colr_='color'
*endif
!
/ui,copy,save,%imgtyp_%,graph,%colr_%,%revrs_%,%orient_%,no,100
!
*set,imgtyp_,
*set,orient_,
*set,revrs_,
*set,colr_,

*if,prkey_,eq,1,then
    /go
*endif