;+ ; NAME: ; tv2im ; PURPOSE: (one line) ; Write the contents of a window or device to a graphics file ; CATEGORY: ; Graphics ; CALLING SEQUENCE: ; tv2im, filename ; INPUTS: ; filename : A string containing the name of file to be written. ; KEYWORD PARAMETERS: ; corner : if set, attempt to set the lower right corner (15x15 pixels) to the ; background color ; true : if set, save in true color ; flip : if set, flip vertically before saving. ; MODIFICATION HISTORY: ; Written 2012 Mar 9, by Leslie Young, SwRI ; 2016 Mar 22 LAY. Added header documentation. ;- pro tv2im, fn, corner=corner, true=true, flip=flip tv = tvrd(true=true) if keyword_set(true) then begin nxnyn,tv,nc,nx,ny if keyword_set(corner) then begin v = tv[*,0:14,0:14] tv[*,nx-15:nx-1,0:14] = v end endif else begin nxnyn,tv,nx,ny if keyword_set(corner) then begin v = tv[0,0] tv[nx-15:nx-1,0:14] = v end endelse if keyword_set(flip) then begin if keyword_set(true) then begin tv = reverse(tv,3) endif else begin tv = reverse(tv,1) endelse endif wrim, fn, tv end