Declined
Last Updated: 20 Mar 2024 11:34 by Petar
Stenly
Created on: 22 Feb 2024 16:25
Category: Diagram
Type: Bug Report
1
Diagram: ExportToImage method does not take into account transforms applied to the diagram items
The ExportToImage method of the RadDiagram control does not take into account transforms applied to the diagram items.
1 comment
Petar
Posted on: 20 Mar 2024 11:34

Generally transformations applied to the shapes can be considered as an unsupported feature. When applied - they effect manipulations (rotate, resize), dragdrop, export, settings pane values etc. We are declining this bug fix as it is related to this unsupported functionality. Diagram is designed in such way that such transformations should be performed with the Diagram API - shapes rotation angle and size, the geometry will stretch accordingly in scale scenarios.

For the specific ExportToImage issue, here are two possible solutions:

1) Set the enclosing bounds parameter explicitly (to avoid being calculated internally): 

  diagram.ExportToImage(stream,
                       enclosingBounds: new Rect(new Size(this.diagram.Width, this.diagram.Height)),
                        backgroundBrush: new SolidColorBrush(Colors.PaleGreen),
                        margin: new(20));

2) Use our ExportExtension methods:

            Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(
                 this.diagram, stream, new System.Windows.Media.Imaging.PngBitmapEncoder());