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. Image for the cookie policy date

Croping Diagram

Hello,

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?

Thanks

3 Replies

GM Gowri Manohari D Syncfusion Team 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,
Gowri





SM Steven Mohnkern 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.

Thanks


GM Gowri Manohari D Syncfusion Team 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.

http://files.syncfusion.com/support/Diagram.Windows/Forums/F82077/main.htm

Let me know whether the above sample meets your requirement.


Regards,
Gowri

Loader.
Live Chat Icon For mobile
Up arrow icon