Exporting to a Bitmap

If you want to email a diagram, or embed it in a Web page or Office document, the most convenient format is a bitmap. WPF Diagrams supports exporting diagrams to PNG, JPEG and BMP format out of the box, and can be easily extended to support other formats such as GIF or TIFF.

The key class for bitmap exports is the DiagramBitmapRenderer. Here’s how to use it for exporting to PNG:

CopyC#
DiagramBitmapRenderer.Png.Render(ds, filename);

This concludes our introduction to the WPF Diagrams library. See the QuickStart sample for full code. You are now ready to build your own applications, or to go on and look at the other samples to get an idea of the built-in options or learn how to customise the diagrams to your own application needs.