telerik/xaml-sdk

Support for image export

anvaya opened this issue · 1 comments

Hello,

Its very common to insert images into a diagram. This export example does not export images. Could you demonstrate how to export images?

Sample code that inserts images (as copied from Telerik example) WPF:

` var image = new System.Windows.Controls.Image
{
Source = new BitmapImage(new Uri(path_to_file, UriKind.Absolute)))
};

                Viewbox viewBox = new Viewbox() { Stretch = Stretch.Fill, Margin = new Thickness(-4) };
                viewBox.Child = image;
                RadDiagramShape imageShape = new RadDiagramShape()
                {
                    Content = viewBox
                };
                this.diagram.Items.Add(imageShape);`

Hello Anvaya,

Thank you for the feedback. Can you please confirm that you mean the ExportToPDF example?

In the meantime, here is some information on the ExporToPDF sample. Basically, it uses the RadPdfProcessing library to write the information from the diagram to a PDF document model and then to a file. Currently, the example exports only text, but it can be extended using the PdfProcessing library. The content export happens in the ExportContent method, where you can implement the image insertion, using the corresponding API.

Regards,
Martin Ivanov
Technical Support | WPF