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


C# System.FillEllipse方法代码示例

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


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

示例1: DrawPoint

        public static void DrawPoint(System.Drawing.Graphics g, PointType type, Color c, float w, float x, float y)
        {
            w = w/2;

            switch (type)
            {
                case PointType.TriangleUp:
                    var triangleUp = new[]
                            {
                                new PointF(x - w, y + w),
                                new PointF(x + w, y + w),
                                new PointF(x, y - w)
                            };
                    g.FillPolygon(new SolidBrush(c), triangleUp);
                    g.DrawPolygon(new Pen(Color.Black, 1), triangleUp);
                    break;

                case PointType.TriangleDown:
                    var triangleDown = new[]
                            {
                                new PointF(x - w, y - w),
                                new PointF(x + w, y - w),
                                new PointF(x, y + w)
                            };
                    g.FillPolygon(new SolidBrush(c), triangleDown);
                    g.DrawPolygon(new Pen(Color.Black, 1), triangleDown);
                    break;

                case PointType.Circle:
                    g.FillEllipse(new SolidBrush(c), x - w, y - w, 2 * w, 2 * w);
                    g.DrawEllipse(new Pen(Color.Black, 1), x - w, y - w, 2 * w, 2 * w);
                    break;
                case PointType.Square:
                    g.FillRectangle(new SolidBrush(c), x - w, y - w, 2 * w, 2 * w);
                    g.DrawRectangle(new Pen(Color.Black, 1), x - w, y - w, 2 * w, 2 * w);
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
开发者ID:zZLOiz,项目名称:cogn-proto,代码行数:40,代码来源:PointDrawer.cs

示例2: Draw

        public override void Draw(System.Drawing.Graphics gr)
        {
            Brush brush = new SolidBrush(Color.Blue);
            PointF pos = Position;

            gr.FillEllipse(brush, pos.X -radius, pos.Y - radius, 2*radius, 2*radius);
        }
开发者ID:alno,项目名称:hse-oop-csharp,代码行数:7,代码来源:Planet.cs

示例3: Draw

        public override void Draw(System.Drawing.Graphics gr)
        {
            Brush brush = new SolidBrush(Color);
            PointF pos = GlobalPos;

            gr.FillEllipse(brush, pos.X - Radius, pos.Y - Radius, 2 * Radius, 2 * Radius);
        }
开发者ID:alno,项目名称:hse-oop-csharp,代码行数:7,代码来源:Satellite.cs

示例4: draw

 public override void draw(System.Drawing.Graphics g)
 {
     if (active)
     {
         g.FillEllipse(Brushes.Black, xCoord - 2f, yCoord - 2f, 4f, 4f);
     }
 }
开发者ID:sjefen6,项目名称:hin.progcsharp.oblig2,代码行数:7,代码来源:Shot.cs

示例5: Draw

        public override void Draw(System.Drawing.Graphics g)
        {
            GraphicsState gs = g.Save();

            PointF[] transformedPoints = this.getScreenBoundsInWorldCoordinates(g);

            g.DrawLine(axisPen, new PointF(base.Position.X, transformedPoints[0].Y), new PointF(base.Position.X, transformedPoints[1].Y));
            g.DrawLine(axisPen, new PointF(transformedPoints[0].X, base.Position.Y), new PointF(transformedPoints[1].X, base.Position.Y));
            #if DEBUG
            g.FillEllipse(Brushes.Maroon, base.Position.X, transformedPoints[0].Y, 10, 10);
            g.FillEllipse(Brushes.Maroon, base.Position.X, transformedPoints[1].Y, -10, -10);
            g.FillEllipse(Brushes.Maroon, transformedPoints[0].X, base.Position.Y, 10, 10);
            g.FillEllipse(Brushes.Maroon, transformedPoints[1].X, base.Position.Y, -10, -10);
            #endif
            g.Restore(gs);
        }
开发者ID:Echo343,项目名称:Cartographer,代码行数:16,代码来源:CartesianAxes.cs

示例6: Paint

        protected override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
        {
            try
            {
                string text = value == null ? "" : (string)value;
                Brush backColorBrush = new SolidBrush(cellStyle.BackColor);
                Brush foreColorBrush = new SolidBrush(cellStyle.ForeColor);
                var col = this.OwningColumn as DataGridViewColorMarkColumn;
                Color markcolor = cellStyle.ForeColor;
                bool hasmark = col.GetColorMark(rowIndex, out markcolor);
                Brush markColorBrush = new SolidBrush(markcolor);

                base.Paint(g, clipBounds, cellBounds,
                    rowIndex, cellState, value, formattedValue, errorText,
                    cellStyle, advancedBorderStyle, (paintParts & ~DataGridViewPaintParts.ContentForeground));

                int rsz = this.DataGridView.RowTemplate.Height - 8;
                int dy = (cellBounds.Height - this.DataGridView.RowTemplate.Height) / 2;

                g.FillEllipse(markColorBrush, cellBounds.X + 2, cellBounds.Y + 4 + dy, rsz, rsz);
                //g.FillRectangle(markColorBrush, cellBounds.X + 2, cellBounds.Y + 4, rsz, rsz);
                g.DrawString(text, cellStyle.Font, foreColorBrush, cellBounds.X + 4 + rsz, cellBounds.Y + 2 + dy);
            }
            catch (Exception e) { }
        }
开发者ID:Camel-RD,项目名称:MyDownloder,代码行数:25,代码来源:DataGridViewColorMarkColumn.cs

示例7: OnPaint

        protected override void OnPaint(System.Drawing.Graphics G)
        {
            G.DrawLine(Pens.Lime, this.Bounds.Left, this.Bounds.Top + this.Bounds.Height / 2, this.Bounds.Right - 1, this.Bounds.Top + this.Bounds.Height / 2);
            G.FillEllipse(Brushes.YellowGreen, this.Bounds.Left + (this.Value - this.MinValue) * this.Bounds.Width / (this.MaxValue - this.MinValue) - 10, this.Bounds.Top + (this.Bounds.Height - 10) / 2, 10, 10);

            base.OnPaint(G);
        }
开发者ID:dalinhuang,项目名称:forest-fire-prevention-framework,代码行数:7,代码来源:VirtualHScroll.cs

示例8: Draw

        /// <summary>
        /// 绘制方法
        /// </summary>
        /// <param name="g"></param>
        /// <param name="center"></param>
        /// <param name="zoom"></param>
        /// <param name="screen_size"></param>
        public override void Draw(System.Drawing.Graphics g, LatLngPoint center, int zoom, System.Drawing.Size screen_size)
        {
            if (Points != null && Points.Count >= 2)
            {
                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
                List<Point> l = new List<Point>();
                foreach (LatLngPoint p in Points)
                {
                    l.Add(MapHelper.GetScreenLocationByLatLng(p, center, zoom, screen_size));  //屏幕坐标
                }
                
                double total = 0; double step = 0;
                using (Pen pen = new Pen(Color.FromArgb(150, Color.OrangeRed), 4))
                {
                    for (int i = 0; i < l.Count - 1; ++i)
                    {
                        g.DrawLine(pen, l[i], l[i + 1]);
                        g.FillEllipse(Brushes.White, new Rectangle(new Point(l[i].X - 4, l[i].Y - 4), new Size(8, 8)));
                        g.DrawEllipse(Pens.OrangeRed, new Rectangle(new Point(l[i].X - 4, l[i].Y - 4), new Size(8, 8)));

                        if (i == 0)  //起点
                        {
                            g.FillRectangle(Brushes.White, new Rectangle(l[i].X + 3, l[i].Y, 35, 20));
                            g.DrawRectangle(Pens.DarkGray, new Rectangle(l[i].X + 3, l[i].Y, 35, 20));
                            g.DrawString("起点", new Font("微软雅黑", 9), Brushes.OrangeRed, new PointF(l[i].X + 6, l[i].Y + 2));

                            if (i == l.Count - 2)  //终点 只有两点的时候
                            {
                                step = MapHelper.GetDistanceByLatLng(Points[i], Points[i + 1]);
                                total += step;

                                g.FillRectangle(Brushes.White, new Rectangle(l[i + 1].X + 3, l[i + 1].Y, 90, 20));
                                g.DrawRectangle(Pens.DarkGray, new Rectangle(l[i + 1].X + 3, l[i + 1].Y, 90, 20));
                                g.DrawString("总长:" + Math.Round(total,2) + "公里", new Font("微软雅黑", 9), Brushes.OrangeRed, new PointF(l[i + 1].X + 10, l[i + 1].Y + 2));
                            }
                        }
                        else //其它点
                        {
                            step = MapHelper.GetDistanceByLatLng(Points[i-1], Points[i]);
                            total += step;

                            g.FillRectangle(Brushes.White, new Rectangle(l[i].X + 3, l[i].Y, 70, 20));
                            g.DrawRectangle(Pens.DarkGray, new Rectangle(l[i].X + 3, l[i].Y, 70, 20));
                            g.DrawString(Math.Round(step,2) + "公里", new Font("微软雅黑", 9), Brushes.OrangeRed, new PointF(l[i].X + 10, l[i].Y + 2));

                            if (i == l.Count - 2)  //终点
                            {
                                step = MapHelper.GetDistanceByLatLng(Points[i], Points[i + 1]);
                                total += step;
                                g.FillRectangle(Brushes.White, new Rectangle(l[i + 1].X + 3, l[i + 1].Y, 100, 20));
                                g.DrawRectangle(Pens.DarkGray, new Rectangle(l[i + 1].X + 3, l[i + 1].Y, 100, 20));
                                g.DrawString("总长:" + Math.Round(total, 2) + "公里", new Font("微软雅黑", 9), Brushes.OrangeRed, new PointF(l[i + 1].X + 10, l[i + 1].Y + 2));
                            }
                        }
                    }
                }
            }
        }
开发者ID:huaan011,项目名称:BMap.NET,代码行数:65,代码来源:BDistance.cs

示例9: Draw

        public override void Draw(System.Drawing.Graphics gr)
        {
            Brush brush = new SolidBrush(Color.Yellow);

            gr.FillEllipse(brush, -radius, -radius, 2*radius, 2*radius);

            foreach ( Planet p in planets )
                p.Draw( gr );
        }
开发者ID:alno,项目名称:hse-oop-csharp,代码行数:9,代码来源:Star.cs

示例10: Draw

 public void Draw(System.Drawing.Graphics g)
 {
     if (Screen.PrimaryScreen.Bounds.Contains(currentFixationLocation))
     {
         int xPos = currentFixationLocation.X - DOTSIZE / 2;
         int yPos = currentFixationLocation.Y - DOTSIZE / 2;
         g.FillEllipse(Brushes.Gray, xPos, yPos, DOTSIZE, DOTSIZE);
     }
 }
开发者ID:AlexanderMcNeill,项目名称:voxvisio,代码行数:9,代码来源:FixationDot.cs

示例11: Draw

 public override void Draw(System.Drawing.Graphics g)
 {
     System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
     System.Drawing.PointF upperLeftPoint = new System.Drawing.PointF((float)(Center.X - RadiusX), (float)(Center.Y - RadiusY));
     System.Drawing.SizeF rectSize = new System.Drawing.SizeF((float)(2 * RadiusX), (float)(2 * RadiusY));
     System.Drawing.RectangleF rect = new System.Drawing.RectangleF(upperLeftPoint, rectSize);
     g.FillEllipse(solidBrush, rect);
     solidBrush.Dispose();
 }
开发者ID:abdonkov,项目名称:HackBulgaria-CSharp,代码行数:9,代码来源:Ellipse.cs

示例12: DrawPoint

 public void DrawPoint(System.Drawing.Graphics graphics)
 {
     if (FillStartPoint != null)
     {
         graphics.FillEllipse(FILL_START_POINT_COLOR,
            FillStartPoint.X - FILL_START_POINT_RADIUS,
            FillStartPoint.Y - FILL_START_POINT_RADIUS,
            FILL_START_POINT_RADIUS * 2, FILL_START_POINT_RADIUS * 2);
     }
 }
开发者ID:idenx,项目名称:FloodFiller,代码行数:10,代码来源:FillStartDrawer.cs

示例13: DibujarElemento

        public override void DibujarElemento(System.Drawing.Graphics grafico)
        {
            Pen p = new Pen(Color, 2);
            p.StartCap = LineCap.Triangle;
            int mitadX = _puerto.DimensionMundo.Centro.X;
            int mitadY = _puerto.DimensionMundo.Centro.Y;
            grafico.DrawLine(p, mitadX, mitadY, mitadX + 30, mitadY - 30);
            grafico.FillEllipse(new SolidBrush(Color), mitadX + 20, mitadY - 30, 10, 10);
            grafico.DrawString(Nombre, new Font("Arial", 8, FontStyle.Regular), Brushes.White, new PointF(mitadX + 30, mitadY - 30));

        }
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:11,代码来源:MarcadorPuertoCompleto.cs

示例14: DibujarElemento

        public override void DibujarElemento(System.Drawing.Graphics grafico)
        {
            Pen p = new Pen(Color, 2);
            p.StartCap = LineCap.Triangle;
            int mitadX = (_conexion.PosicionMundoPuerto1.X + _conexion.PosicionMundoPuerto2.X) / 2;
            int mitadY = (_conexion.PosicionMundoPuerto1.Y + _conexion.PosicionMundoPuerto2.Y) / 2;
            grafico.DrawLine(p, mitadX, mitadY, mitadX + 30, mitadY - 30);
            grafico.FillEllipse(new SolidBrush(Color), mitadX + 20, mitadY - 30, 10, 10);
            grafico.DrawString(Nombre, new Font("Arial", 8, FontStyle.Regular), Brushes.White, new PointF(mitadX + 30, mitadY - 30));

        }
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:11,代码来源:MarcadorCable.cs

示例15: Draw

 public override void Draw(System.Drawing.Graphics g, int panX, int panY)
 {
     int tempx1 = x1 - panX;
     int tempx2 = x2 - panX;
     int tempy1 = y1 - panY;
     int tempy2 = y2 - panY;
     if (needFilling)
         g.FillEllipse(filling, tempx1, tempy1, tempx2 - tempx1, tempy2 - tempy1);
     if (needOutline)
         g.DrawEllipse(outline, tempx1, tempy1, tempx2 - tempx1, tempy2 - tempy1);
 }
开发者ID:ItramariN,项目名称:lab,代码行数:11,代码来源:Ellipse.cs


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