Problem when export to BMP

Hi, I have a problem when I export a diagram to JPG, when the diagram is very large, the image looks bad, and looks very pixilated.
This is my code:

Rect bounds = myDiagram.Panel.DiagramBounds;
Double w = bounds.Width;
Double h = bounds.Height;
Double scale = 2.0;
If (w> 2000) scale = 5000 / w;
If (h> 2000) scale = Math.Min (scale, 5000 / h);
W * = scale;
H * = scale;
This.myDiagram.Panel.MakeBitmap (new Size (w, h), 96, new Point (bounds.X, bounds.Y), scale, bmp =>
WriteableBitmap bitmap = new WriteableBitmap (bmp);
Var img = bitmap.ToImage ();
Using (Stream stream = sd.OpenFile ())
Img.WriteToStream (stream);
MessageWindow Message = new MessageWindow ();
Message.TextError.Text = "Finished export";

If I change “w” or “h” I have a error out of memory… I need the image to look better. Can you export to a vector graphic?

Yes, by default DiagramPanel.MakeBitmap limits the resulting bitmap image size to 2000x2000 pixels, to reduce the chance of memory errors. You could explicitly specify a larger size, but then you run the risk of using too much memory.

GoXam does not provide any direct-to-SVG renderer, because you can have arbitrary FrameworkElements in your Nodes or Links, which we would not know how to render. However you might be able to use third-part software that renders FrameworkElements as SVG.

When you print the resulting XPS document might be considered to be vector graphics. But I don’t know if that would satisfy your requirements.