CASE WIDGET_INFO(event.ID,/uName) OF 'seldraw1': BEGIN str.SELIDX=0 WIDGET_CONTROL, event.TOP,Set_uvalue= str END 'seldraw2': BEGIN str.SELIDX=1 WIDGET_CONTROL, event.TOP,Set_uvalue= str END 'OpenJPG': BEGIN file = DIALOG_PICKFILE(path = 'd:temp',filter='*.jpg') IF file EQ '' THEN RETURN; WIDGET_CONTROL, str.WFILELIST, set_value= file END 'Show': BEGIN WIDGET_CONTROL, str.WFILELIST, get_value= file IF FILE_TEST(file) THEN BEGIN
READ_JPEG,file,data ; ;调用ENVI数据打开,则数据支持就无敌了,ENVI能打开的程序都能显示。 ; ENVI_OPEN_FILE, file, r_fid=fid ; ENVI_FILE_QUERY, fid, dims=dims,ns= ns, nl =nl,DATA_TYPE = DATA_TYPE ; ; ; data = make_array(3,ns,nl,TYPE = DATA_TYPE) ; for i=0,2 do begin ; data[i,*,*] = ENVI_GET_DATA(fid=fid, dims=dims, pos=i) ; endfor
;直接图形法 IF str.SELIDX EQ 0 THEN BEGIN ;WSET,str.WDRAW2 str.OIMAGE->SETPROPERTY,/hide str.WDRAW2->DRAW,str.OVIEW ERASE WSET,str.WDRAW1 TVSCL,data,/true ;tvscl,data ;对象图形法 ENDIF ELSE BEGIN WSET,str.WDRAW1 ERASE str.OIMAGE->SETPROPERTY,data = data,hide=0 str.WDRAW2->DRAW,str.OVIEW ENDELSE ENDIF END ELSE: ENDCASE END ;析构函数 PRO MAIN_CLEANUP,tlb ; WIDGET_CONTROL, tlb,get_uvalue = str OBJ_DESTROY,str.OVIEW