PRO it_savegif_event,event @dt_com COMMON xxx,pathbox,filebox,btns,vidbtn,img CASE event.id OF ;{ pathbox:BEGIN ;{ WIDGET_CONTROL,pathbox,GET_VALUE=savpath WIDGET_CONTROL,pathbox,SET_VALUE=savpath END ;} filebox:BEGIN ;{ WIDGET_CONTROL,filebox,SET_VALUE=file END ;} btns:BEGIN ;{ CASE event.value OF 'SAVE':BEGIN ;{ tvlct,r,g,b,/GET WIDGET_CONTROL,pathbox,GET_VALUE=path WIDGET_CONTROL,filebox,GET_VALUE=file WIDGET_CONTROL,vidbtn,GET_VALUE=test path=path(0) file=file(0) ; WRITE_GIF,path+file,BYTE(img),r,g,b WRITE_SRF,path+file,BYTE(img),r,g,b,order=1 IF (test EQ 1) THEN BEGIN ;{ sz=SIZE(img) temp=INTARR(640,480) ani_array=img(0:sz(2)-1,0:sz(2)-1) text=img(sz(2):sz(1)-1,0:sz(2)-1) text=CONGRID(text,150,432) ani_array=CONGRID(ani_array,432,432) temp(32:463,24:455)=ani_array temp(464:613,24:455)=text WINDOW,/FREE,XSIZE=640,ysize=480 tv,temp file=file+' ' STRPUT,file,'vid.gif',STRLEN(file)-7 ; WRITE_GIF,path+file,BYTE(temp),r,g,b WRITE_SRF,path+file,BYTE(temp),r,g,b,order=1 END ;} savpath=path WIDGET_CONTROL,event.top,/DESTROY END ;} 'DONE':BEGIN ;{ WIDGET_CONTROL,event.top,/DESTROY END ;} ENDCASE END ;} vidbtn:BEGIN ;{ print,'IT_SAVEGIF: Will save a copy of image in 640x480' END ;} ENDCASE ;} END PRO it_savegif,image @dt_com COMMON xxx,pathbox,filebox,btns,vidbtn,img img=image path=curdir() file='' base=WIDGET_BASE(TITLE='Save Image as GIF',/COLUMN) t=WIDGET_LABEL(base,VALUE='Enter Path:') pathbox=WIDGET_TEXT(base,XSIZE=40,VALUE=savpath,/EDITABLE) t=WIDGET_LABEL(base,VALUE='Enter Filename:') filebox=WIDGET_TEXT(base,VALUE=file,/EDITABLE) btns=CW_BGROUP(base,['SAVE','DONE'],/ROW,/RETURN_NAME) vidbtn=CW_BGROUP(base,/ROW,/NONEXCLUSIVE,['Save Video format']) WIDGET_CONTROL,base,/REALIZE XMANAGER,'it_savegif',base END