Re: IDLgrWindow zoomIn bug? [message #59679] |
Tue, 08 April 2008 01:23  |
Erik[1]
Messages: 23 Registered: December 2006
|
Junior Member |
|
|
On 8 apr, 06:02, David Fanning <n...@dfanning.com> wrote:
> Erik writes:
>> I have a problem using the ZoomIn function from the IDLgrWindow object
>> in IDL 6.3. According to the IDL help file I expected the following to
>> happen:
>
>> ---
>> The IDLgrWindow::ZoomIn procedure method causes the current zoom
>> factor for this window to be increased (that is, multiplied by the
>> factor given by the window's ZOOM_BASE property). The current zoom
>> factor, the virtual canvas dimensions, and the location of the visible
>> portion of the window are updated to reflect the new zoom factor.
>
> I've never used the ZoomIn/ZoomOut features before. But
> I just put it into a program that was zooming in a different
> way. For me, when I zoom in, the draw widget gets twice its
> current size!! Zoom out, it shrinks down again.
>
> I don't know about you, but that is not what I expected
> at all. (IDL 6.4 on Windows). I was sort of hoping the
> view would zoom in and out. Why would you want the draw
> widget changing size!?
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Hi David,
Wow that isn't what I expected either and I was hoping the same thing
as you! I can't check it in 6.4, but in 6.3 it didn't work that way.
Well, it seems that I have to continue writing my own zoom code and
that it wasn't a waste of time writing it. Only some minor issues I
have to face (like re-drawing the ROI's in the same proportion as the
zoomed image) ;-)
Thanks
|
|
|
Re: IDLgrWindow zoomIn bug? [message #59682 is a reply to message #59679] |
Mon, 07 April 2008 21:02   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Erik writes:
> I have a problem using the ZoomIn function from the IDLgrWindow object
> in IDL 6.3. According to the IDL help file I expected the following to
> happen:
>
> ---
> The IDLgrWindow::ZoomIn procedure method causes the current zoom
> factor for this window to be increased (that is, multiplied by the
> factor given by the window's ZOOM_BASE property). The current zoom
> factor, the virtual canvas dimensions, and the location of the visible
> portion of the window are updated to reflect the new zoom factor.
I've never used the ZoomIn/ZoomOut features before. But
I just put it into a program that was zooming in a different
way. For me, when I zoom in, the draw widget gets twice its
current size!! Zoom out, it shrinks down again.
I don't know about you, but that is not what I expected
at all. (IDL 6.4 on Windows). I was sort of hoping the
view would zoom in and out. Why would you want the draw
widget changing size!?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: IDLgrWindow zoomIn bug? [message #59766 is a reply to message #59679] |
Tue, 08 April 2008 08:47  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
Erik wrote:
> On 8 apr, 06:02, David Fanning wrote:
>> I've never used the ZoomIn/ZoomOut features before. But
>> I just put it into a program that was zooming in a different
>> way. For me, when I zoom in, the draw widget gets twice its
>> current size!! Zoom out, it shrinks down again.
>>
>> I don't know about you, but that is not what I expected
>> at all. (IDL 6.4 on Windows). I was sort of hoping the
>> view would zoom in and out. Why would you want the draw
>> widget changing size!?
> Wow that isn't what I expected either and I was hoping the same thing
> as you! I can't check it in 6.4, but in 6.3 it didn't work that way.
> Well, it seems that I have to continue writing my own zoom code and
> that it wasn't a waste of time writing it. Only some minor issues I
> have to face (like re-drawing the ROI's in the same proportion as the
> zoomed image) ;-)
Erik, How are you zooming? I never use ROI's, but I would think that
if you are zooming by changing your viewplane rectangle that the ROI's
would "zoom" too. Here's the zoom method from my camera code:
pro Camera::Zoom, zoom
; Zoom the camera view by the specified zoom factor.
compile_opt idl2
if (N_ELEMENTS(zoom) eq 1) then begin
case 1 of
(zoom lt -1.0) : self.zoom = (-1.0D / zoom)
(zoom gt 1.0) : self.zoom = zoom
else : self.zoom = 1.0D
endcase
viewplaneRect = dblarr(4, /NOZERO)
viewplaneRect[0:1] = self.viewcoord[0:1] - $
(self.viewRect[2:3] / (2.0D * self.zoom))
viewplaneRect[2:3] = self.viewRect[2:3] / self.zoom
self -> IDLgrView::SetProperty, VIEWPLANE_RECT= viewplaneRect
endif
end
Set up the vars that store the initial state once, after you have set up
your initial view:
self -> IDLgrView::GetProperty, VIEWPLANE_RECT=viewplaneRect
self.viewRect = viewplaneRect
self.viewcoord[0] = ((2. * self.viewRect[0]) + $
self.viewRect[2]) / 2.
self.viewcoord[1] = ((2. * self.viewRect[1]) + $
self.viewRect[3]) / 2.
-Rick
|
|
|