Exemplo n.º 1
0
        /// <summary>
        /// Exports the specified <see cref="PlotModel" /> to the specified <see cref="Stream" />.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="stream">The stream.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        public static void Export(IPlotModel model, Stream stream, double width, double height)
        {
            var exporter = new XpsExporter {
                Width = width, Height = height
            };

            exporter.Export(model, stream);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Prints the specified plot model.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="width">The width (using the actual media width if set to NaN).</param>
        /// <param name="height">The height (using the actual media height if set to NaN).</param>
        public static void Print(IPlotModel model, double width, double height)
        {
            var exporter = new XpsExporter {
                Width = width, Height = height, Background = model.Background
            };

            exporter.Print(model);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Exports the specified plot model to an xps file.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="fileName">The file name.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="background">The background color.</param>
 public static void Export(IPlotModel model, string fileName, double width, double height, OxyColor background)
 {
     using (var stream = File.Open(fileName, FileMode.Create, FileAccess.ReadWrite))
     {
         var exporter = new XpsExporter {
             Width = width, Height = height, Background = background
         };
         exporter.Export(model, stream);
     }
 }