当前位置: 首页>>代码示例>>C#>>正文


C# PlotModel.Update方法代码示例

本文整理汇总了C#中OxyPlot.PlotModel.Update方法的典型用法代码示例。如果您正苦于以下问题:C# PlotModel.Update方法的具体用法?C# PlotModel.Update怎么用?C# PlotModel.Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OxyPlot.PlotModel的用法示例。


在下文中一共展示了PlotModel.Update方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Export

 /// <summary>
 /// Exports the specified model to a file.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="width">The width (points).</param>
 /// <param name="height">The height (points).</param>
 /// <param name="textMeasurer">The text measurer.</param>
 public static void Export(PlotModel model, string fileName, double width, double height, IRenderContext textMeasurer = null)
 {
     using (var svgrc = new SvgRenderContext(fileName, width, height, textMeasurer))
     {
         model.Update();
         model.Render(svgrc);
     }
 }
开发者ID:jgodinez,项目名称:OxyPlot.2DGraphLib.MonoTouch,代码行数:16,代码来源:SvgExporter.cs

示例2: Export

 /// <summary>
 /// Exports the specified model to a stream.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="stream">The output stream.</param>
 /// <param name="width">The width (points).</param>
 /// <param name="height">The height (points).</param>
 /// <param name="isDocument">if set to <c>true</c>, the xml headers will be included (?xml and !DOCTYPE).</param>
 /// <param name="textMeasurer">The text measurer.</param>
 public static void Export(PlotModel model, Stream stream, double width, double height, bool isDocument, IRenderContext textMeasurer)
 {
     using (var rc = new SvgRenderContext(stream, width, height, true, textMeasurer, model.Background))
     {
         model.Update();
         model.Render(rc, width, height);
         rc.Complete();
         rc.Flush();
     }
 }
开发者ID:AndrewTPohlmann,项目名称:open-hardware-monitor,代码行数:19,代码来源:SvgExporter.cs

示例3: Export

        public static void Export(PlotModel model, string fileName, int width, int height, Brush background = null)
        {
            using (var bm = new Bitmap(width, height))
            {
                using (Graphics g = Graphics.FromImage(bm))
                {
                    if (background != null)
                    {
                        g.FillRectangle(background, 0, 0, width, height);
                    }

                    var rc = new GraphicsRenderContext { RendersToScreen = false };
                    rc.SetGraphicsTarget(g);
                    model.Update();
                    model.Render(rc, width, height);
                    bm.Save(fileName, ImageFormat.Png);
                }
            }
        }
开发者ID:microe1,项目名称:MouseComparator,代码行数:19,代码来源:MousePlot.cs

示例4: Export

        /// <summary>
        /// Exports the specified plot model to a stream.
        /// </summary>
        /// <param name="model">The plot model.</param>
        /// <param name="stream">The stream to write to.</param>
        /// <param name="width">The width of the export image.</param>
        /// <param name="height">The height of the exported image.</param>
        /// <param name="background">The background.</param>
        public static void Export(PlotModel model, Stream stream, double width, double height, OxyColor background = null)
        {
            var canvas = new Canvas { Width = width, Height = height };
            if (background != null)
            {
                canvas.Background = background.ToBrush();
            }

            canvas.Measure(new Size(width, height));
            canvas.Arrange(new Rect(0, 0, width, height));

            var rc = new SilverlightRenderContext(canvas);
            model.Update();
            model.Render(rc, width, height);

            canvas.UpdateLayout();
            var image = canvas.ToImage();
            image.WriteToStream(stream);
        }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:27,代码来源:PngExporter.cs

示例5: DoCreateChartImage

 protected override Image DoCreateChartImage()
 {
     var plotModel = new PlotModel("");
     var ls = new LineSeries("")
         {
             Points = Parameters.SeriaData.Select(t => new DataPoint(t.Key, t.Value) as IDataPoint).ToList()
         };
     plotModel.Series.Add(ls);
     plotModel.Axes.Add(new LinearAxis(AxisPosition.Left));
     plotModel.Axes.Add(new LinearAxis(AxisPosition.Bottom));
     var bitmap = new Bitmap(Parameters.ChartWidth, Parameters.ChartHeight);
     using (var graphics = Graphics.FromImage(bitmap))
     {
         var graphicsRenderContext = new GraphicsRenderContext { RendersToScreen = false };
         graphicsRenderContext.SetGraphicsTarget(graphics);
         plotModel.Update();
         plotModel.Render(graphicsRenderContext, Parameters.ChartWidth, Parameters.ChartHeight);
         return bitmap;
     }
 }
开发者ID:nus-ii,项目名称:DotNetChartingOverview,代码行数:20,代码来源:OxyPlotAdapter.cs

示例6: ExportToString

        /// <summary>
        /// Exports to string.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="width">The width (points).</param>
        /// <param name="height">The height (points).</param>
        /// <param name="textMeasurer">The text measurer.</param>
        /// <param name="isDocument">if set to <c>true</c>, the xml headers will be included (?xml and !DOCTYPE).</param>
        /// <returns>
        /// The plot as a svg string.
        /// </returns>
        public static string ExportToString(PlotModel model, double width, double height, bool isDocument = false, IRenderContext textMeasurer = null)
        {
            string svg;
            using (var ms = new MemoryStream())
            {
                var svgrc = new SvgRenderContext(ms, width, height, isDocument, textMeasurer);
                model.Update();
                model.Render(svgrc);
                svgrc.Complete();
                svgrc.Flush();
                ms.Flush();
                ms.Position = 0;
                var sr = new StreamReader(ms);
                svg = sr.ReadToEnd();
            }

            return svg;
        }
开发者ID:jgodinez,项目名称:OxyPlot.2DGraphLib.MonoTouch,代码行数:29,代码来源:SvgExporter.cs


注:本文中的OxyPlot.PlotModel.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。