Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram zoom out from rectangle api !? (Read 1968 times)
MikeHeal
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 20
Joined: Feb 5th, 2020
Diagram zoom out from rectangle api !?
May 11th, 2021 at 7:21pm
Print Post  
Hello, I am using mindFusion controls for my wpf diagraming needs. Recently i got stuck with zooming out logic..

To zoom into a particular selected diagram area i am using;
diagram.ZoomToRect(diagram.Selection.Bounds, true); //works fine, with a lot of zoomIn % though.

How can I zoom Out (say, 30 units) based on the area selected. Do we have something like: ZoomOutFromRect.. !? Roll Eyes

Thanks a ton.
« Last Edit: May 12th, 2021 at 1:50am by MikeHeal »  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: Diagram zoom out from rectangle api !?
Reply #1 - May 12th, 2021 at 6:19am
Print Post  
Hi,

Try this -

Code
Select All
diagram.SetZoomFactor(
    diagram.ZoomFactor - xx,
    Center(diagram.Viewport)); 



or

Code
Select All
var viewport = diagram.Viewport;
viewport.Inflate(xx, yy);
diagram.ZoomToRect(viewport, true); 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
MikeHeal
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 20
Joined: Feb 5th, 2020
Re: Diagram zoom out from rectangle api !?
Reply #2 - May 12th, 2021 at 3:30pm
Print Post  
Thanks works great.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint