Is it possible to export the whole diagram as an image?
Image image =
this
.radDiagram1.ExportToImage(
new
Size(10000, 5000));
Clipboard.SetImage(image);
This only exports the visible area which gives me scrollbars which is not what I need. I want the entire diagram as an image.
Thanks
Paul
3 Answers, 1 is accepted
Thank you for writing us.
The method you are using is obsolete as of our latest release. If you want to export the diagram, you can call the ExportToImage method without arguments. All shapes and connections are exported. Please refer to the code snippet below:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
Image image =
this
.radDiagram1.ExportToImage();
image.Save(@
"..\..\exportedDiagram.bmp"
);
}
In the you can find the sample too.
Should you have further questions, I would be glad to help.
Regards,
Ralitsa
Telerik
That's unfortunate about the vector export, I saw a post from 2013 that vector export should be available in the next version.
As for saving all diagram, looks like ExportToImage doesn't like negative positions. If I change the example that you referenced to start at negative position, exported image is blank. I'll just have to avoid negative positions.
Hello, Giedrius,
I would like to note that back into 2013, RadDiagram was not available in the Telerik UI for WinForms suite. RadDiagram was introduced in R1 2015.
Could you please specify where exactly did you find such information that vector export should be available in the next version? I suppose that you may not be using RadDiagram from the Telerik UI for WinForms suite.
Your question has already been answered in the support thread (Ticket ID: 1479868) you have opened on the same topic. Please, see our answer there for more information. However, I am posting the answer here as well in order the community to benefit from it.
Currently, RadDiagram provides a method only for exporting its current state to an image file. Export to vector images is not available. If we have similar requests from other customers, we will consider vector image export implementation in the future improvement of the control.
Feel free to use the ExportToImage method without arguments. All shapes and connections are exported even outside the visible area.
As to the negative positions, please have a look at the attached gif file. It seems that all shapes are exported to the image even though I pan in a way to hide the shapes from the visible area. Am I missing something? Could you please specify the exact steps how to reproduce the problem?
We kindly ask you to use just one thread for a specific problem to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.
Thank you for your understanding.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik