comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » zoom at widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
zoom at widgets [message #92357] Sat, 28 November 2015 05:43 Go to previous message
skymaxwell@gmail.com is currently offline  skymaxwell@gmail.com
Messages: 127
Registered: January 2007
Senior Member
I have 2 draw widgets. The first - it's full image (draw_widget) and second zoom_widget.

For draw_widget i turn on button events and motion events

draw_widget=WIDGET_DRAW(draw_base,XSIZE=1440,YSIZE=720,/MOTI ON_EVENTS,$
/BUTTON_EVENTS,X_SCROLL_SIZE=720,Y_SCROLL_SIZE=360,EVENT_PRO = "doMove")

state={pImage:PTR_NEW(image),$ ;pointer to image
langCat:oLangCat, $ ;langcat
workDir:workDir,$ ;dir for save
localDir:local_dir,$ ;dir current
draw:draw_widget,$ ;full image will be here
imageLoaded:0,$ ;is image loaded ?
label:label_value,$ ;label
zoom:zoom_draw, $ ; zoom widget
...
}

I suggest need to do the following

1. get X,Y
2. get Window ID
3. use TVRD(my region)
4. CONGRID OR REBIN
5. get and set Window ID for zoom widget
6. use TVSCL to do output in zoom widget

here is fragment of code

PRO doMove,event
WIDGET_CONTROL,event.top,GET_UVALUE=pState
x=event.x
y=event.y
...
;if mouse button was pressed
IF (event.press EQ 1) THEN BEGIN
CATCH
IF ((*pState).imageLoaded NE 0) THEN BEGIN
data=*(*pState).pImage ;get image
WIDGET_CONTROL,(*pState).draw,GET_VALUE=id ;get ID
WSET,id ;set ID
zoom_data=TVRD(x-20,y-20,10,10) ; read current graphics
zoom_data=CONGRID(zoom_data,360,360,/interp) ; what is better congrid or rebin ?
WIDGET_CONTROL,(*pstate).zoom,GET_VALUE=id ;get ID zoom
WSET,id ; set zoom current
TVSCL,zoom_data ;output
ENDIF
ENDIF
END

it's don't worked as well. it's don't showing zoom at all regions of full image
And zoom images not like original image

Thanks
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem discovered in bandpass_filter.pro
Next Topic: ROI of 3D volumes (multiple 2D slices)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:19:04 PDT 2025

Total time taken to generate the page: 0.00419 seconds