public static void RenderShapeToDisk(string dataDir, Shape shape)
{
//ExStart
//ExFor:ShapeRenderer
//ExFor:ShapeBase.GetShapeRenderer
//ExFor:ImageSaveOptions
//ExFor:ImageSaveOptions.Scale
//ExFor:ShapeRenderer.Save(String, ImageSaveOptions)
//ExId:RenderShapeToDisk
//ExSummary:Shows how to render a shape independent of the document to an EMF image and save it to disk.
// The shape render is retrieved using this method. This is made into a separate object from the shape as it internally
// caches the rendered shape.
ShapeRenderer r = shape.GetShapeRenderer();
// Define custom options which control how the image is rendered. Render the shape to the JPEG raster format.
ImageSaveOptions imageOptions = new ImageSaveOptions(SaveFormat.Emf)
{
Scale = 1.5f
};
// Save the rendered image to disk.
r.Save(dataDir + "TestFile.RenderToDisk Out.emf", imageOptions);
//ExEnd
}