Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Zoom In/out problem (Read 1496 times)
ayushneema
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 23rd, 2009
Zoom In/out problem
Sep 26th, 2009 at 1:53pm
Print Post  
hi
I am implementing zoom In/out functionality on diagram. Diagram contain two shape node. i place this shape node on some location. so when i am do zoom in/out the node doesnot appear at the center of the diagram.
so
1. how can i find the center of the diagram? and set the nodes position according to the center.
2. can i set the center for the zoom in/out functionality. so when i do zoom in/out diagram move towards that center.

Thanks
Ayush Neema
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zoom In/out problem
Reply #1 - Sep 27th, 2009 at 11:09am
Print Post  
Hi,

After changing ZoomFactor, call diagram.BringIntoView(node, true) to set the scroll position in such a way that the node is at the center of the currently visible area. This also depends on the scroll range of the ScrollViewer that contains the diagram, and the node might not appear exactly at the center if it's near the diagram border.

You can't set the zoom center, but you could call ZoomToRect to zoom and center the view on the specified rectangle. That will let you zoom towards some point by creating a rectangle with that point at the center. Zooming in can be done by setting the rectangle size to be smaller than the currently visible area, and zooming out - by setting a larger size.

For another ways to zoom at a specified point, use the Search link at the top of the forum page and search for 'MouseWheel'.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint