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


C# IGraphics.FillClosedCurve方法代码示例

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


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

示例1: PaintMarkers

 private void PaintMarkers(IGraphics g, int off, int width, int height)
 {
     Pen fgPen = new Pen(ForeColor);
     for (int i = 0; i < Colors.Count; i++){
         Pen p = new Pen(Colors[i]);
         int a = ModelToView(Positions[i], width, height);
         int d = ((i == mouseOverIndex) && (Arrow == Arrows.First || Arrow == Arrows.Both)) ? triangleHeight : 0;
         if (Vertical){
             int e = ((i == mouseOverIndex)) && (Arrow == Arrows.Second || Arrow == Arrows.Both)
                 ? width - 1 - triangleHeight : width - 1;
             g.DrawLine(p, 0, a, width - 1, a);
             g.DrawLine(fgPen, d, a - 1, off - 1, a - 1);
             g.DrawLine(fgPen, d, a + 1, off - 1, a + 1);
             g.DrawLine(fgPen, off + StripWidth + 1, a - 1, e, a - 1);
             g.DrawLine(fgPen, off + StripWidth + 1, a + 1, e, a + 1);
         } else{
             int e = ((i == mouseOverIndex)) && (Arrow == Arrows.Second || Arrow == Arrows.Both)
                 ? height - 1 - triangleHeight : height - 1;
             g.DrawLine(p, a, 0, a, height - 1);
             g.DrawLine(fgPen, a - 1, d, a - 1, off - 1);
             g.DrawLine(fgPen, a + 1, d, a + 1, off - 1);
             g.DrawLine(fgPen, a - 1, off + StripWidth + 1, a - 1, e);
             g.DrawLine(fgPen, a + 1, off + StripWidth + 1, a + 1, e);
         }
         if (i == mouseOverIndex){
             Brush b = new SolidBrush(p.Color);
             if (Vertical){
                 if (Arrow == Arrows.Second || Arrow == Arrows.Both){
                     Point[] points = new[]{
                         new Point(width - 1 - triangleHeight, a - 1), new Point(width - 1 - triangleHeight, a - triangleBase2),
                         new Point(width - 1, a), new Point(width - 1 - triangleHeight, a + triangleBase2),
                         new Point(width - 1 - triangleHeight, a + 1)
                     };
                     g.FillClosedCurve(b, points);
                     g.DrawCurve(fgPen, points);
                 }
                 if (Arrow == Arrows.First || Arrow == Arrows.Both){
                     Point[] points = new[]{
                         new Point(triangleHeight, a - 1), new Point(triangleHeight, a - triangleBase2), new Point(0, a),
                         new Point(triangleHeight, a + triangleBase2), new Point(triangleHeight, a + 1)
                     };
                     g.FillClosedCurve(b, points);
                     g.DrawCurve(fgPen, points);
                 }
             } else{
                 Point[] points = new[]{
                     new Point(a - 1, height - 1 - triangleHeight), new Point(a - triangleBase2, height - 1 - triangleHeight),
                     new Point(a, height - 1), new Point(a + triangleBase2, height - 1 - triangleHeight),
                     new Point(a + 1, height - 1 - triangleHeight)
                 };
                 g.FillClosedCurve(b, points);
                 g.DrawCurve(fgPen, points);
                 points = new[]{
                     new Point(a - 1, triangleHeight), new Point(a - triangleBase2, triangleHeight), new Point(a, 0),
                     new Point(a + triangleBase2, triangleHeight), new Point(a + 1, triangleHeight)
                 };
                 g.FillClosedCurve(b, points);
                 g.DrawCurve(fgPen, points);
             }
         }
     }
 }
开发者ID:neuhauser,项目名称:compbio-base,代码行数:62,代码来源:ColorStripView.cs

示例2: Render


//.........这里部分代码省略.........
                new PointF(120, 120),
                new PointF(150, 80),
                new PointF(80, 150),
                new PointF(80, 110)
            };

                ig.DrawCurve(new Pen(Color.Blue, 5), curvy);
                ig.DrawCurve(new Pen(Color.Red, 2), curvy, 2, 3);
                ig.DrawCurve(new Pen(Color.Yellow, 1), curvy, 1f);

                Point[] ccurvy = new Point[]
            {
                new Point(280, 30),
                new Point(260, 60),
                new Point(200, 20),
                new Point(290, 120),
                new Point(290, 80),
                new Point(230, 150),
                new Point(150, 50)
            };
                ig.DrawClosedCurve(new Pen(Color.Green, 3), ccurvy, 1f, FillMode.Alternate);
                ig.DrawClosedCurve(new Pen(Color.Purple, 1), ccurvy, 0f, FillMode.Alternate);

                Point[] fcc = new Point[]
            {
                new Point(160, 350),
                new Point(190, 370),
                new Point(130, 390),
                new Point(190, 400),
                new Point(195, 410),
                new Point(100, 430),
                new Point(160, 450)
            };
                ig.FillClosedCurve(new SolidBrush(Color.Red), fcc, FillMode.Winding, 1f);
                ig.FillClosedCurve(new SolidBrush(Color.Aquamarine), fcc, FillMode.Alternate, .2f);

            }
            else if (s == "Transparency")
            {
                Point[] fillpoly = new Point[]
                {
                    new Point(20, 130),
                    new Point(60, 90),
                    new Point(30, 20),
                    new Point(80, 20),
                    new Point(15, 90),
                    new Point(100, 50),
                    new Point(0, 50)
                };

                Color col = Color.FromArgb(96,255,0,0);

                ig.FillEllipse(new SolidBrush(Color.Ivory), 60, 140, 60, 30);
                ig.FillPolygon(new SolidBrush(Color.Ivory), fillpoly, FillMode.Winding);

                ig.TranslateTransform(10,10);
                ig.FillEllipse(new SolidBrush(col), 60, 140, 60, 30);
                ig.FillPolygon(new SolidBrush(col), fillpoly, FillMode.Alternate);
                ig.ResetTransform();

                ig.FillPie(new SolidBrush(Color.FromArgb(100,255,0,0)), 10, 200, 200, 80, 315, 90);
                ig.FillPie(new SolidBrush(Color.FromArgb(100,128,128,0)), 10, 200, 200, 80, 250, -90);
                ig.FillPie(new SolidBrush(Color.FromArgb(100,128,0,128)), 15, 205, 190, 70, 180, 270);
                ig.FillPie(new SolidBrush(Color.FromArgb(100,200,60,60)), 20, 210, 180, 60, 45, -270);

            }
开发者ID:luizcorreia,项目名称:SvgNet,代码行数:67,代码来源:Form1.cs

示例3: PaintMoveUpButton

 public static void PaintMoveUpButton(IGraphics g, Brush2 b, int x, int y, int bsize)
 {
     Pen2 w = new Pen2(Color2.White, 2);
     PaintRoundButton(g, b, w, x, y, bsize);
     g.FillClosedCurve(Brushes2.White,
         new[]{new Point2(x + bsize/2, y + 4), new Point2(x + 5, y + bsize - 4), new Point2(x + bsize - 5, y + bsize - 4)});
 }
开发者ID:JurgenCox,项目名称:compbio-base,代码行数:7,代码来源:GraphUtil.cs


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