Industrial Data Science
in C# and .NET:
Simple. Fast. Reliable.

ILNumerics - Technical Computing

Modern High Performance Tools for Technical

Computing and Visualization in Industry and Science


Offscreen Rendering

GDI renderers are prepared for off-screen rendering. No visual surface is required. In order to save a scene as PNG file, one needs to provide the final resolution and the scene to be rendered:

We simply made a new scene from scratch and use it with an GDIDriver for saving. Just as well, one may take an existing scene from any other driver or Panel.Scene and use it with GDIDriver. Note that no precautions are necessary regarding shared scenes. Scenes can be reused at any time and rendered concurrently in multithreading setups.

The same principle applies to other drivers. In order to save a scene (for example from an existing panel ilPanel1.Scene) as static SVG vector graphics file ‘test.svg’:

Note that ILNumerics SVG driver is capable of handling arbitrary 2D and 3D scenes. However, because most (if not all) current SVG rendering engines nowadays render SVG primitives in antialiasing mode, rendering artifacts will be visible for abutting edges. We do our best to minimize their disturbing effect. Nevertheless, one should keep this in mind if attempting to render complex 3D scenes in SVG. The effect is 'by design'.


A nice example for offscreen rendering has been given by Scott Hanselmann on his blog.