;-------------- CloseZBuff.pro ----------------- ; ; Copy contents of Z buffer and save in JPEG file ; PRO CloseZBuff, file COMMON waveserver_common, path, urlpath, nolog ; Copy the contents of the Z buffer img = TVRD(0,0,!D.X_VSIZE,!D.Y_VSIZE) ERASE DEVICE, /CLOSE ; Get the current color palette (which we must switch ; to a device other than the Z buffer to do, because ; TVLCT returns an error with the Z buffer device). set_plot,'PS' TVLCT, r, g, b, /Get set_plot,'Z' ; Save image as jpg file img = IMAGE_CREATE(img, Colormap=TRANSPOSE([[r],[g],[b]]), $ Colormodel=1) status = IMAGE_WRITE(file, img, file_type='GIF', /Compress, $ /Overwrite) END