PRO qImage_cw_Blowup, state ;+ ; NAME: ; qImage_cw_Blowup ; PURPOSE: ; Get small portion of image in main draw widget and put it in the small ; draw widget at the top right ; CATEGORY: ; Compound widget qImage_cw ; CALLING SEQUENCE: ; qImage_cw_Blowup, state, image, edge ; INPUTS: ; state array[1]; type: structure ; qImage_cw state structure ; OUTPUTS: ; (to state.wid_blowup draw widget) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; qImage_cw_Box, qImage_cw_BoxImage, MagnifyArray ; PROCEDURE: ; The current box setting is setting is extracted using qImage_cwBox. ; A small section centered on the box center is extracted from the curren ; image and is put in the blowup draw widget. ; If the current box is very close to the edge than the blowup will be ; shifted relative to the center to prevent it from moving outside the ; image boundary. ; STATE INFO USED: ; MODIFICATION HISTORY: ; FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- IF widget_info(state.wid_blowup, /valid_id) THEN BEGIN qImage_cw_Box, state, box, /get screen_size = qImage_cw_Property(state, /screen_size) blowup_size = qImage_cw_Property(state, /blowup_size, window_nr=wnew) magnification = 4 dxy = (blowup_size/magnification-1)/2 box = 0.5*total(box,2) ; Center of box box = qImage_cw_Transform(state, fromimage=box, /toscreen) box = round(box) box = box#[1,1]+dxy#[-1,1] ; Center dxy on box center box = box + (-(box[0:1] < 0)#[1,1] ) box = box - ((box[2:3]-screen_size+1) > 0)#[1,1] box = box > 0 tmp = qImage_cw_BoxImage(state, box, sub_img=sub_img, /screen) wold = !d.window IF wnew NE wold THEN wset, wnew tv, MagnifyArray(sub_img, magnification) IF wnew NE wold THEN wset, wold ENDIF RETURN & END