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


C# Bgr.Draw方法代码示例

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


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

示例1: Main

        static void Main()
        {
            //create a managed image
            var image = new Bgr<byte>[480, 640];

            //draw something
            image.Draw(new Rectangle(50, 50, 200, 100), Bgr<byte>.Red, -1);
            image.Draw(new Circle(50, 50, 25), Bgr<byte>.Blue, 5);
            image.Draw(new Box2D(new Point(250, 150), new Size(100, 100), 30), Bgr<byte>.Green, 1);
            image.Draw("Hello world!", Font.Big, new Point(10, 100), Bgr<byte>.White);

            //save and load
            image.Save("out.png");
            ImageIO.LoadColor("out.png").Clone().Show(scaleForm: true);
        }
开发者ID:bestwpw,项目名称:dot-imaging,代码行数:15,代码来源:Program.cs

示例2: BasicImageOperationsDemo

        public BasicImageOperationsDemo()
        {
            InitializeComponent();

            //create a managed image
            var image = new Bgr<byte>[480, 640];

            //draw something
            image.Draw(new Rectangle(50, 50, 200, 100), Bgr<byte>.Red, -1);
            image.Draw(new Circle(50, 50, 25), Bgr<byte>.Blue, 5);
            image.Draw(new Box2D(new Point(250, 150), new Size(100, 100), 30), Bgr<byte>.Green, 1);
            image.Draw("Hello world!", CvFont.Big, new Point(10, 100), Bgr<byte>.White);

            //save and load
            image.Save("out.png");
            pictureBox.Image = ImageIO.LoadColor("out.png").ToBitmap();
        }
开发者ID:adhameed,项目名称:dot-imaging,代码行数:17,代码来源:BasicImageOperationsDemo.cs

示例3: Main

        static void Main()
        {
            //load from the Web
            var image = new Uri("http://vignette3.wikia.nocookie.net/disney/images/5/5d/Lena_headey_.jpg")
                            .GetBytes()
                            .DecodeAsColorImage();

            //show image
            image.Show("New Lena"); //to zoom or translate: press and hold Shift and scroll or move your mouse

            image = new Bgr<byte>[480, 640];

            //draw something
            image.Draw(new Rectangle(50, 50, 200, 100), Bgr<byte>.Red, -1);
            image.Draw(new Circle(50, 50, 25), Bgr<byte>.Blue, 5);
            image.Draw(new Box2D(new Point(250, 150), new Size(100, 100), 30), Bgr<byte>.Green, 1);
            image.Draw("Hello world!", Font.Big, new Point(10, 100), Bgr<byte>.White);

            //save and load
            image.Save("out.png");
            ImageIO.LoadColor("out.png").Clone().Show("Saved image", scaleForm: true);
        }
开发者ID:gitter-badger,项目名称:dot-imaging,代码行数:22,代码来源:Program.cs

示例4: drawParticles

 private void drawParticles(IEnumerable<ColorParticle> particles, Bgr<byte>[,] img)
 {
     var circles = particles.Select(x => new Circle { X = (int)x.Position.X, Y = (int)x.Position.Y, Radius = 2 });
     img.Draw(circles, Bgr<byte>.Blue, 5);
 }
开发者ID:Candy29,项目名称:accord-net-extensions,代码行数:5,代码来源:ColorParticleDemo.cs


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