// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) 2014 OxyPlot contributors
//
//
// Provides extension methods to the .
//
// --------------------------------------------------------------------------------------------------------------------
namespace OxyPlot.WindowsForms
{
using System;
using System.Drawing;
///
/// Provides extension methods to the .
///
public static class PlotModelExtensions
{
///
/// Creates an SVG string.
///
/// The model.
/// The width (points).
/// The height (points).
/// if set to true, the xml headers will be included (?xml and !DOCTYPE).
/// A .
public static string ToSvg(this PlotModel model, double width, double height, bool isDocument)
{
using (var g = Graphics.FromHwnd(IntPtr.Zero))
{
using (var rc = new GraphicsRenderContext(g) { RendersToScreen = false })
{
return OxyPlot.SvgExporter.ExportToString(model, width, height, isDocument, rc);
}
}
}
}
}