Ejemplo n.º 1
0
        /// <summary>
        /// Exports the specified plot model to a stream.
        /// </summary>
        /// <param name="plotModel">The model to export.</param>
        /// <param name="stream">The stream.</param>
        /// <param name="width">The width of the output bitmap.</param>
        /// <param name="height">The height of the output bitmap.</param>
        /// <param name="background">The background color. The default value is <c>null</c>.</param>
        /// <param name="resolution">The resolution (resolution). The default value is 96.</param>
        public static void Export(IPlotModel plotModel, Stream stream, int width, int height, OxyColor background, int resolution = 96)
        {
            var exporter = new TiffExporter {
                Width = width, Height = height, Background = background, Resolution = resolution
            };

            exporter.Export(plotModel, stream);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Exports the specified plot model to a bitmap.
        /// </summary>
        /// <param name="plotModel">The plot model.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="background">The background.</param>
        /// <param name="resolution">The resolution (dpi).</param>
        /// <returns>A bitmap.</returns>
        public static BitmapSource ExportToBitmap(
            IPlotModel plotModel,
            int width,
            int height,
            OxyColor background,
            int resolution = 96
            )
        {
            var exporter = new TiffExporter {
                Width = width, Height = height, Background = background, Resolution = resolution
            };

            return(exporter.ExportToBitmap(plotModel));
        }