/// <summary> /// Exports the specified <see cref="PlotModel"/> to the specified <see cref="Stream"/>. /// </summary> /// <param name="model">The model.</param> /// <param name="stream">The output stream.</param> public void Export(IPlotModel model, Stream stream) { using (var rc = new ImageRenderContext(this.Width, this.Height, model.Background, this.Resolution)) { var dpiScale = this.Resolution / 96; model.Update(true); model.Render(rc, new OxyRect(0, 0, this.Width / dpiScale, this.Height / dpiScale)); rc.SaveAsPng(stream); } }
/// <summary> /// Exports the specified <see cref="PlotModel"/> to the specified <see cref="Stream"/>. /// </summary> /// <param name="model">The model.</param> /// <param name="stream">The output stream.</param> public void Export(IPlotModel model, Stream stream) { var background = model.Background.IsInvisible() ? OxyColors.White : model.Background; using (var rc = new ImageRenderContext(this.Width, this.Height, background, this.Resolution)) { var dpiScale = this.Resolution / 96; model.Update(true); model.Render(rc, new OxyRect(0, 0, this.Width / dpiScale, this.Height / dpiScale)); rc.SaveAsJpeg(stream, this.Quality); } }