• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# OxyColor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中OxyColor的典型用法代码示例。如果您正苦于以下问题:C# OxyColor类的具体用法?C# OxyColor怎么用?C# OxyColor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OxyColor类属于命名空间,在下文中一共展示了OxyColor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ErrorColumnItem

 /// <summary>
 /// Initializes a new instance of the <see cref="ErrorColumnItem"/> class.
 /// </summary>
 /// <param name="value">
 /// The value.
 /// </param>
 /// <param name="error">
 /// The error.
 /// </param>
 /// <param name="categoryIndex">
 /// Index of the category.
 /// </param>
 /// <param name="color">
 /// The color.
 /// </param>
 public ErrorColumnItem(double value, double error, int categoryIndex = -1, OxyColor color = null)
 {
     this.Value = value;
     this.Error = error;
     this.CategoryIndex = categoryIndex;
     this.Color = color;
 }
开发者ID:jgodinez,项目名称:OxyPlot.2DGraphLib.MonoTouch,代码行数:22,代码来源:ErrorColumnItem.cs


示例2: Export

 /// <summary>
 /// Exports the specified plot model to a file.
 /// </summary>
 /// <param name="model">The model to export.</param>
 /// <param name="fileName">The file name.</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(PlotModel model, string fileName, int width, int height, OxyColor background, int resolution = 96)
 {
     using (var s = File.Create(fileName))
     {
         Export(model, s, width, height, background, resolution);
     }
 }
开发者ID:apmKrauser,项目名称:RCUModulTest,代码行数:16,代码来源:PngExporter.cs


示例3: ExportToString

        /// <summary>
        /// Export the specified plot model to an xaml string.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="background">The background.</param>
        /// <returns>A xaml string.</returns>
        public static string ExportToString(PlotModel model, double width, double height, OxyColor background = null)
        {
            var g = new Grid();
            if (background != null)
            {
                g.Background = background.ToBrush();
            }

            var c = new Canvas();
            g.Children.Add(c);

            var size = new Size(width, height);
            g.Measure(size);
            g.Arrange(new Rect(0, 0, width, height));
            g.UpdateLayout();

            var rc = new ShapesRenderContext(c) { UseStreamGeometry = false };
            model.Update();
            model.Render(rc, width, height);

            var sb = new StringBuilder();
            using (var sw = new StringWriter(sb))
            {
                var xw = XmlWriter.Create(sw, new XmlWriterSettings { Indent = true });
                XamlWriter.Save(c, xw);
            }

            return sb.ToString();
        }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:37,代码来源:XamlExporter.cs


示例4: HighLowSeries

 public HighLowSeries(OxyColor color, double strokeThickness = 1, string title = null)
     : this()
 {
     this.Color = color;
     this.StrokeThickness = strokeThickness;
     this.Title = title;
 }
开发者ID:Cheesebaron,项目名称:oxyplot,代码行数:7,代码来源:HighLowSeries.cs


示例5: Export

 /// <summary>
 /// Exports the specified plot model to a xaml file.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="background">The background.</param>
 public static void Export(PlotModel model, string fileName, double width, double height, OxyColor background)
 {
     using (var w = new StreamWriter(fileName))
     {
         w.Write(ExportToString(model, width, height, background));
     }
 }
开发者ID:benjaminrupp,项目名称:oxyplot,代码行数:15,代码来源:XamlExporter.cs


示例6: IntervalBarItem

 /// <summary>
 /// Initializes a new instance of the <see cref="IntervalBarItem"/> class.
 /// </summary>
 /// <param name="start">
 /// The start.
 /// </param>
 /// <param name="end">
 /// The end.
 /// </param>
 /// <param name="title">
 /// The title.
 /// </param>
 /// <param name="color">
 /// The color.
 /// </param>
 public IntervalBarItem(double start, double end, string title = null, OxyColor color = null)
 {
     this.Start = start;
     this.End = end;
     this.Title = title;
     this.Color = color;
 }
开发者ID:jwolfm98,项目名称:HardwareMonitor,代码行数:22,代码来源:IntervalBarItem.cs


示例7: Export

        /// <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 xpsPackage = Package.Open(fileName, FileMode.Create, FileAccess.ReadWrite))
            {
                using (var doc = new XpsDocument(xpsPackage))
                {
                    var canvas = new Canvas { Width = width, Height = height, Background = background.ToBrush() };
                    canvas.Measure(new Size(width, height));
                    canvas.Arrange(new Rect(0, 0, width, height));

                    var rc = new ShapesRenderContext(canvas);
#if !NET35
                    rc.TextFormattingMode = TextFormattingMode.Ideal;
#endif

                    model.Update(true);
                    model.Render(rc, width, height);

                    canvas.UpdateLayout();

                    var xpsdw = XpsDocument.CreateXpsDocumentWriter(doc);
                    xpsdw.Write(canvas);
                }
            }
        }
开发者ID:benjaminrupp,项目名称:oxyplot,代码行数:33,代码来源:XpsExporter.cs


示例8: ScatterSeries

 /// <summary>
 /// Initializes a new instance of the <see cref="ScatterSeries"/> class.
 /// </summary>
 /// <param name="title">
 /// The title.
 /// </param>
 /// <param name="markerFill">
 /// The marker fill color.
 /// </param>
 /// <param name="markerSize">
 /// Size of the markers (If ScatterPoint.Size is set, this value will be overridden).
 /// </param>
 public ScatterSeries(string title, OxyColor markerFill = null, double markerSize = 5)
     : this()
 {
     this.MarkerFill = markerFill;
     this.MarkerSize = markerSize;
     this.Title = title;
 }
开发者ID:jwolfm98,项目名称:HardwareMonitor,代码行数:19,代码来源:ScatterSeries.cs


示例9: DrawEllipse

        /// <summary>
        /// Draws an ellipse.
        /// </summary>
        /// <param name="rect">The rectangle.</param>
        /// <param name="fill">The fill color.</param>
        /// <param name="stroke">The stroke color.</param>
        /// <param name="thickness">The thickness.</param>
        public override void DrawEllipse(OxyRect rect, OxyColor fill, OxyColor stroke, double thickness)
        {
            this.SetAlias(false);
            var convertedRectangle = rect.Convert();
            if (fill.IsVisible())
            {
                this.SetFill(fill);
                using (var path = new CGPath())
                {
                    path.AddEllipseInRect(convertedRectangle);
                    this.gctx.AddPath(path);
                }

                this.gctx.DrawPath(CGPathDrawingMode.Fill);
            }

            if (stroke.IsVisible() && thickness > 0)
            {
                this.SetStroke(stroke, thickness);

                using (var path = new CGPath())
                {
                    path.AddEllipseInRect(convertedRectangle);
                    this.gctx.AddPath(path);
                }

                this.gctx.DrawPath(CGPathDrawingMode.Stroke);
            }
        }
开发者ID:benjaminrupp,项目名称:oxyplot,代码行数:36,代码来源:CoreGraphicsRenderContext.cs


示例10: DrawLine

        public void DrawLine(IList<ScreenPoint> points, OxyColor stroke, double thickness, double[] dashArray,
                             OxyPenLineJoin lineJoin, bool aliased)
        {
            var e = new Polyline();
            if (stroke != null && thickness > 0)
            {
                e.Stroke = GetCachedBrush(stroke);

                switch (lineJoin)
                {
                    case OxyPenLineJoin.Round:
                        e.StrokeLineJoin = PenLineJoin.Round;
                        break;
                    case OxyPenLineJoin.Bevel:
                        e.StrokeLineJoin = PenLineJoin.Bevel;
                        break;
                    //  The default StrokeLineJoin is Miter
                }

                if (thickness != 1) // default values is 1
                    e.StrokeThickness = thickness;
                if (dashArray != null)
                    e.StrokeDashArray = new DoubleCollection(dashArray);
            }
            // pl.Fill = null;
            if (aliased)
                e.SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased);

            var pc = new PointCollection(points.Count);
            foreach (var p in points)
                pc.Add(ToPoint(p));
            e.Points = pc;

            Add(e);
        }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:35,代码来源:GeometryRenderContext.cs


示例11: Export

 /// <summary>
 /// Exports the specified plot model to a xaml file.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="background">The background.</param>
 public static void Export(PlotModel model, string fileName, double width, double height, OxyColor background)
 {
     using (var sw = new StreamWriter(fileName))
     {
         var xw = XmlWriter.Create(sw, new XmlWriterSettings { Indent = true });
         Export(model, xw, width, height, background);
     }
 }
开发者ID:apmKrauser,项目名称:RCUModulTest,代码行数:16,代码来源:XamlExporter.cs


示例12: Export

 /// <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);
     }
 }
开发者ID:huoxudong125,项目名称:oxyplot,代码行数:16,代码来源:XpsExporter.cs


示例13: RectangleBarItem

 /// <summary>
 /// Initializes a new instance of the <see cref="RectangleBarItem"/> class.
 /// </summary>
 /// <param name="x0">
 /// The x0.
 /// </param>
 /// <param name="y0">
 /// The y0.
 /// </param>
 /// <param name="x1">
 /// The x1.
 /// </param>
 /// <param name="y1">
 /// The y1.
 /// </param>
 /// <param name="title">
 /// The title.
 /// </param>
 /// <param name="color">
 /// The color.
 /// </param>
 public RectangleBarItem(double x0, double y0, double x1, double y1, string title = null, OxyColor color = null)
 {
     this.X0 = x0;
     this.Y0 = y0;
     this.X1 = x1;
     this.Y1 = y1;
     this.Title = title;
     this.Color = color;
 }
开发者ID:AndrewTPohlmann,项目名称:open-hardware-monitor,代码行数:30,代码来源:RectangleBarItem.cs


示例14: Export

        /// <summary>
        /// Exports the specified plot model to a 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>
        /// <param name="background">The background.</param>
        /// <param name="resolution">The resolution.</param>
        public static void Export(PlotModel model, Stream stream, int width, int height, OxyColor background = null, int resolution = 96)
        {
            var bmp = ExportToBitmap(model, width, height, background);

            var encoder = new PngBitmapEncoder();
            encoder.Frames.Add(BitmapFrame.Create(bmp));

            encoder.Save(stream);
        }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:18,代码来源:PngExporter.cs


示例15: ExportToString

        /// <summary>
        /// Export the specified plot model to an xaml string.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        /// <param name="background">The background.</param>
        /// <returns>A xaml string.</returns>
        public static string ExportToString(IPlotModel model, double width, double height, OxyColor background)
        {
            var sb = new StringBuilder();
            using (var sw = new StringWriter(sb))
            {
                var xw = XmlWriter.Create(sw, new XmlWriterSettings { Indent = true });
                Export(model, xw, width, height, background);
            }

            return sb.ToString();
        }
开发者ID:apmKrauser,项目名称:RCUModulTest,代码行数:19,代码来源:XamlExporter.cs


示例16: PdfRenderContext

 /// <summary>
 /// Initializes a new instance of the <see cref="PdfRenderContext" /> class.
 /// </summary>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="background">The background color.</param>
 public PdfRenderContext(double width, double height, OxyColor background)
 {
     this.RendersToScreen = false;
     this.doc = new PdfDocument();
     var page = new PdfPage { Width = new XUnit(width), Height = new XUnit(height) };
     this.doc.AddPage(page);
     this.g = XGraphics.FromPdfPage(page);
     if (background.IsVisible())
     {
         this.g.DrawRectangle(ToBrush(background), 0, 0, width, height);
     }
 }
开发者ID:benjaminrupp,项目名称:oxyplot,代码行数:18,代码来源:PdfRenderContext.cs


示例17: TornadoBarItem

 /// <summary>
 /// Initializes a new instance of the <see cref="TornadoBarItem"/> class.
 /// </summary>
 /// <param name="minimum">
 /// The minimum.
 /// </param>
 /// <param name="maximum">
 /// The maximum.
 /// </param>
 /// <param name="baseValue">
 /// The base value.
 /// </param>
 /// <param name="minimumColor">
 /// The minimum color.
 /// </param>
 /// <param name="maximumColor">
 /// The maximum color.
 /// </param>
 public TornadoBarItem(
     double minimum,
     double maximum,
     double baseValue = double.NaN,
     OxyColor minimumColor = null,
     OxyColor maximumColor = null)
 {
     this.Minimum = minimum;
     this.Maximum = maximum;
     this.BaseValue = baseValue;
     this.MinimumColor = minimumColor;
     this.MaximumColor = maximumColor;
 }
开发者ID:jgodinez,项目名称:OxyPlot.2DGraphLib.MonoTouch,代码行数:31,代码来源:TornadoBarItem.cs


示例18: FromArgbX

 public void FromArgbX()
 {
     var data = new OxyColor[2, 4];
     data[1, 0] = OxyColors.Blue;
     data[1, 1] = OxyColors.Green;
     data[1, 2] = OxyColors.Red;
     data[1, 3] = OxyColors.White;
     data[0, 0] = OxyColors.Yellow.ChangeAlpha(127);
     data[0, 1] = OxyColors.Orange.ChangeAlpha(127);
     data[0, 2] = OxyColors.Pink.ChangeAlpha(127);
     data[0, 3] = OxyColors.Transparent;
     var img = OxyImage.FromArgbX(data);
     var bytes = img.GetData();
     File.WriteAllBytes("FromArgbX.bmp", bytes);
 }
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:15,代码来源:OxyImageTests.cs


示例19: Create_SmallImageToBmp

 public void Create_SmallImageToBmp()
 {
     var data = new OxyColor[2, 4];
     data[1, 0] = OxyColors.Blue;
     data[1, 1] = OxyColors.Green;
     data[1, 2] = OxyColors.Red;
     data[1, 3] = OxyColors.White;
     data[0, 0] = OxyColor.FromAColor(127, OxyColors.Yellow);
     data[0, 1] = OxyColor.FromAColor(127, OxyColors.Orange);
     data[0, 2] = OxyColor.FromAColor(127, OxyColors.Pink);
     data[0, 3] = OxyColors.Transparent;
     var img = OxyImage.Create(data, ImageFormat.Bmp, new BmpEncoderOptions());
     var bytes = img.GetData();
     File.WriteAllBytes(@"Imaging\SmallImage.bmp", bytes);
 }
开发者ID:benjaminrupp,项目名称:oxyplot,代码行数:15,代码来源:OxyImageTests.cs


示例20: Create_LargeImageToPng

        public void Create_LargeImageToPng()
        {
            int w = 266;
            int h = 40;
            var data = new OxyColor[w, h];
            for (int y = 0; y < h; y++)
            {
                for (int x = 0; x < w; x++)
                {
                    data[x, y] = OxyColor.FromHsv((double)x / w, 1, 1);
                }
            }

            var img = OxyImage.Create(data, ImageFormat.Png);
            var bytes = img.GetData();
            File.WriteAllBytes(@"Imaging\LargeImage.png", bytes);
        }
开发者ID:benjaminrupp,项目名称:oxyplot,代码行数:17,代码来源:OxyImageTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# OxyPenLineJoin类代码示例发布时间:2022-05-24
下一篇:
C# Ownership类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap