Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: IDLgrWindow...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 5613 of 6400
Post > Topic >>

Re: IDLgrWindow zoomIn bug?

by Rick Towler <rick.towler@[EMAIL PROTECTED] > Apr 8, 2008 at 08:47 AM

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 pro****tion 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
 




 5 Posts in Topic:
IDLgrWindow zoomIn bug?
Erik <janssen.e@[EMAIL  2008-04-07 04:03:06 
Re: IDLgrWindow zoomIn bug?
David Fanning <news@[E  2008-04-07 22:02:49 
Re: IDLgrWindow zoomIn bug?
Erik <janssen.e@[EMAIL  2008-04-08 01:23:43 
Re: IDLgrWindow zoomIn bug?
Rick Towler <rick.towl  2008-04-08 08:47:26 
Re: IDLgrWindow zoomIn bug?
Erik <janssen.e@[EMAIL  2008-04-09 03:29:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Nov 19 10:09:39 CST 2008.