The issue related with bitmap cropping when exporting via SvgExporter.
The code:
// Set the position to the origin.
// Its just an example node that draw a bitmap.
// This node doesn't have 'RenderTransform' or 'RotationAngle'.
// It will render correctly.
var testImageNodeBounds = Bounds with { X = 0, Y = 0 };
var testImageNode = new SvgNode()
{
Image = bitmapImage,
Transparent = true,
Bounds = testImageNodeBounds,
TextBrush = Brushes.LightBlue,
};
testImageNode.Text = $"Bounds: {testImageNodeBounds} \n " +
$"Rotation is: {testImageNode.RotationAngle} \n " +
$"Render transform is: \n {testImageNode.RenderTransform}";
// This is the real one.
// We are trying to draw an image that have a 'RotationAngle' and 'RenderTransform'.
// It will be cropped.
var realImageNode = new SvgNode()
{
Image = bitmapImage,
Transparent = true,
RenderTransform = RenderTransform,
RotationAngle = RotationAngle,
Bounds = Bounds,
Text = $"Bounds: {Bounds} \n Rotation is: {RotationAngle} \n Render transform is: \n {RenderTransform}",
TextBrush = Brushes.LightBlue,
};
printDiagram.Items.Add(testImageNode);
printDiagram.Items.Add(realImageNode);
I also tried to export into stream/file but anyways its cropped:
var svgExporter = new SvgExporter()
{
SetClipPaths = true,
};
var svgStream = new MemoryStream();
svgExporter.Export(atsDiagramControl, svgStream);
svgStream.Seek(0, SeekOrigin.Begin);
svgExporter.Export(atsDiagramControl, "testSvg.svg");
svgStream.Seek(0, SeekOrigin.Begin);
Attachments:
1) See the diagram that we expect while exporting.
2) The resulting SVG after export (by SvgExporter). For some reason cannot upload the resulting SVG, I am attaching the file that I posted on the file hosting:
https://dropmefiles.com/sQFCB