PRO df_savegif_event,event COMMON xxx,pathbox,filebox,btns,vidbtn,img,filename CASE event.id OF ;{ pathbox:BEGIN ;{ WIDGET_CONTROL,pathbox,GET_VALUE=savpath WIDGET_CONTROL,pathbox,SET_VALUE=savpath END ;} filebox:BEGIN ;{ WIDGET_CONTROL,filebox,GET_VALUE=filename WIDGET_CONTROL,filebox,SET_VALUE=filename END ;} btns:BEGIN ;{ CASE event.value OF 'SAVE':BEGIN ;{ ;difcol tvlct,r,g,b,/GET WIDGET_CONTROL,pathbox,GET_VALUE=path WIDGET_CONTROL,filebox,GET_VALUE=filename WIDGET_CONTROL,vidbtn,GET_VALUE=test path=path(0) path=path+'/' filename=filename(0) WRITE_GIF,path+filename,BYTE(img),r,g,b 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 filename=filename+' ' STRPUT,file,'vid.gif',STRLEN(file)-7 WRITE_GIF,path+filename,BYTE(temp),r,g,b END ;} savpath=path WIDGET_CONTROL,event.top,/DESTROY END ;} 'DONE':BEGIN ;{ WIDGET_CONTROL,event.top,/DESTROY END ;} ENDCASE END ;} vidbtn:BEGIN ;{ MESSAGE,'Will save a copy of image in 640x480' END ;} ENDCASE ;} END PRO df_savegif,image,filenm COMMON xxx,pathbox,filebox,btns,vidbtn,img,filename img=image path=curdir() savpath=path filename=filenm+'.subt.gif' 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=filename,/EDITABLE) btns=CW_BGROUP(base,['SAVE','DONE'],/ROW,/RETURN_NAME) vidbtn=CW_BGROUP(base,/ROW,/NONEXCLUSIVE,['Save Video format']) WIDGET_CONTROL,base,/REALIZE XMANAGER,'df_savegif',base END