We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Zoom to Fit

Thread ID:

Created:

Updated:

Platform:

Replies:

32165 Jul 22,2005 12:51 PM Jul 28,2005 11:43 AM Windows Forms 2
loading
Tags: Diagram
Jeff Fansler
Asked On July 22, 2005 12:51 PM

Is there an easy way to add a zoom to fit feature that would fit the diagram into the control bounds?

Administrator [Syncfusion]
Replied On July 26, 2005 03:29 PM

Hi Jeff, You can use the Diagram.View.Magnification property to set a magnification ratio that scales the diagram to fit the control bounds. The scale ratio can be estimated as follows, Size scaleratio = new Size((int)((this.diagramComponent.View.Width/this.diagramComponent.Model.Bounds.Width)*100), (int)((this.diagramComponent.View.Height/this.diagramComponent.Model.Height)*100)); this.diagramComponent.View.Magnification = scaleratio; this.diagramComponent.View.Origin = new PointF(0,0); this.diagramComponent.View.Update(true); Regards, Prakash Surendra Syncfusion Inc.,

Jeff Fansler
Replied On July 28, 2005 11:43 AM

Hi Prakash, This worked great. Thanks. -Jeff >Hi Jeff, > >You can use the Diagram.View.Magnification property to set a magnification ratio that scales the diagram to fit the control bounds. The scale ratio can be estimated as follows, > >Size scaleratio = new Size((int)((this.diagramComponent.View.Width/this.diagramComponent.Model.Bounds.Width)*100), (int)((this.diagramComponent.View.Height/this.diagramComponent.Model.Height)*100)); > >this.diagramComponent.View.Magnification = scaleratio; >this.diagramComponent.View.Origin = new PointF(0,0); >this.diagramComponent.View.Update(true); > >Regards, >Prakash Surendra >Syncfusion Inc.,

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;