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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Croping Diagram

Thread ID:





82077 May 31,2009 09:27 PM UTC Jun 5,2009 11:54 AM UTC WinForms 3
Tags: Diagram
Administrator [Syncfusion]
Asked On May 31, 2009 09:27 PM UTC


I need to insert an image of my diagram into an Excel spreadsheet. To have the greatest image size possible, I would like to crop the diagram to include only the area containing nodes and not the entire document size. Is there a simple way to do this?


Gowri Manohari D [Syncfusion]
Replied On June 1, 2009 09:27 AM UTC

Hi SteveM,

Thanks for choosing Syncfusion Products.

Syncfusion Diagram has property called SizeToContent. It is boolean value if it is set to true means,diagram will remove the all unwanted spaces in the document and crop the image area. The below is the code snippet.

diagram1.Model.SizeToContent = true;

Let me know this will reach your requirement

Thanks & Regards,

Steven Mohnkern
Replied On June 3, 2009 01:32 PM UTC

Yes. That is what I am currently using. I was just wondering if you had a way to have a bigger document in the diagram viewer which could be cropped just when printing or saving to an image.


Gowri Manohari D [Syncfusion]
Replied On June 5, 2009 11:54 AM UTC

Hi SteveM,

I have created sample for your requirement.There is no direct method for save/print the Crop Diagram.We can save the crop diagram using some other logic or methods.

The functionality of the sample is to Save the selected nodes in the diagram.Before click the save button in the sample you should select what part of diagram wants to Save.Load button loads the diagram which you saved before.

Please download the sample from the below link.


Let me know whether the above sample meets your requirement.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon