Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Zoom - How to get current zoom rectangle (Read 2850 times)
Sushant Raut
Guest


Zoom - How to get current zoom rectangle
Jan 10th, 2006 at 9:56am
Print Post  
I want to add functionality of zooming flowchart on the mouse wheel. If mouse wheel event occurs I want to change zooming. For that I want to get current zoom rectangle (view rectangle) of flowchart. So that I can modify this rectangle and zoom to new rectangle. Is there any property or method for getting it? Or is there any other way of doing this?


further, if possible,  I want to add functionality like zooming with mouse wheel by considering mouse pointer position. this zoom should happen around mouse pointer position.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zoom - How to get current zoom rectangle
Reply #1 - Jan 10th, 2006 at 10:41am
Print Post  
You can get the current view rectangle like this:

RectangleF viewRect = fc.ClientToDoc(fc.ClientRectangle);

Then you could use the ZoomToRect method to zoom to the modified rectangle.

I hope that helps
  
Back to top
 
IP Logged
 
Sushant Raut
Guest


Re: Zoom - How to get current zoom rectangle
Reply #2 - Jan 11th, 2006 at 4:22am
Print Post  
I have tried this clientRectangle property. It always returns rectangle at zoomfactor 100. Means we does not get a rectangle at different zoom factors.

I think that I have to do manual calculation for getting  current zoom rectangle. This can be done using client rectangle and zoom factor. Please tell me if u find any code/way to do this.
  
Back to top
 
IP Logged
 
Sushant Raut
Guest


Re: Zoom - How to get current zoom rectangle
Reply #3 - Jan 11th, 2006 at 4:25am
Print Post  
I have tried this clientRectangle property. It always returns rectangle at zoomfactor 100. Means we do not get a rectangle at different zoom factors.

I think that I have to do manual calculation for getting  current zoom rectangle. This can be done using client rectangle and zoom factor. Please tell me if u find any code/way to do this.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zoom - How to get current zoom rectangle
Reply #4 - Jan 11th, 2006 at 5:02am
Print Post  
ClientRectangle returns the size of any control in Pixels. Pass that rectangle to ClientToDoc and you will get the document coordinates of the currently visible area, with scroll position and zoom factor included:

fc.ClientToDoc(fc.ClientRectangle);
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint