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


C# Graphics.FillPie方法代码示例

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


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

示例1: Draw

 public void Draw(Graphics g)
 {
     if (isOpen)
     {
         g.FillEllipse(brush, X * 2 * RADIUS, Y * 2 * RADIUS, RADIUS * 2, RADIUS * 2);
     }
     else
     {
         if (Direction == DIRECTION.RIGHT)
         {
             g.FillPie(brush, X * 2 * RADIUS, Y * 2 * RADIUS, RADIUS * 2, RADIUS * 2, 45, 270);
         }
         else if (Direction == DIRECTION.LEFT)
         {
             g.FillPie(brush, X * 2 * RADIUS, Y * 2 * RADIUS, RADIUS * 2, RADIUS * 2, 225, 270);
         }
         else if (Direction == DIRECTION.UP)
         {
             g.FillPie(brush, X * 2 * RADIUS, Y * 2 * RADIUS, RADIUS * 2, RADIUS * 2, 315, 270);
         }
         else
         {
             g.FillPie(brush, X * 2 * RADIUS, Y * 2 * RADIUS, RADIUS * 2, RADIUS * 2, 135, 270);
         }
     }
 }
开发者ID:KristijanLaskovski,项目名称:VPLab8,代码行数:26,代码来源:Pacman.cs

示例2: Draw

        public override void Draw(RectangleF rect)
        {
            Graphics g = new Graphics();

            //g.Clear(Color.White);

            // Create a pen object:
            Pen aPen = new Pen(Color.Blue, 1 / g.DpiX);
            // Create a brush object with a transparent red color:
            SolidBrush aBrush = new SolidBrush(Color.Red);

            g.PageUnit = GraphicsUnit.Inch;
            g.PageScale = 2;
            g.RenderingOrigin = new PointF(0.5f,0.0f);

            // Draw a rectangle:
            g.DrawRectangle(aPen, .20f, .20f, 1.00f, .50f);
            // Draw a filled rectangle:
            g.FillRectangle(aBrush, .20f, .90f, 1.00f, .50f);
            // Draw ellipse:
            g.DrawEllipse(aPen, new RectangleF(.20f, 1.60f, 1.00f, .50f));
            // Draw filled ellipse:
            g.FillEllipse(aBrush, new RectangleF(1.70f, .20f, 1.00f, .50f));
            // Draw arc:
            g.DrawArc(aPen, new RectangleF(1.70f, .90f, 1.00f, .50f), -90, 180);

            // Draw filled pie pieces
            g.FillPie(aBrush, 1.70f, 1.60f, 1.00f, 1.00f, -90, 90);
            g.FillPie(Brushes.Green, 1.70f, 1.60f, 1.00f, 1.00f, -90, -90);

            g.Dispose();
        }
开发者ID:stnk3000,项目名称:sysdrawing-coregraphics,代码行数:32,代码来源:DrawingView.cs

示例3: DrawRect

        public override void DrawRect(System.Drawing.RectangleF dirtyRect)
        {
            Graphics g = new Graphics();

            g.Clear(Color.White);
            g.SmoothingMode = SmoothingMode.AntiAlias;
            // Create a pen object:
            Pen aPen = new Pen(Color.Blue, 2);
            // Create a brush object with a transparent red color:
            SolidBrush aBrush = new SolidBrush(Color.Red);
            HatchBrush hBrush = new HatchBrush(HatchStyle.Shingle, Color.Blue, Color.LightCoral);
            HatchBrush hBrush2 = new HatchBrush(HatchStyle.Cross, Color.Blue, Color.LightCoral);
            HatchBrush hBrush3 = new HatchBrush(HatchStyle.BackwardDiagonal, Color.Blue, Color.LightCoral);
            HatchBrush hBrush4 = new HatchBrush(HatchStyle.Sphere, Color.Blue, Color.LightCoral);

            // Draw a rectangle:
            g.DrawRectangle(aPen, 20, 20, 100, 50);
            // Draw a filled rectangle:
            g.FillRectangle(hBrush, 20, 90, 100, 50);
            // Draw ellipse:
            g.DrawEllipse(aPen, new Rectangle(20, 160, 100, 50));
            // Draw filled ellipse:
            g.FillEllipse(hBrush2, new Rectangle(170, 20, 100, 50));
            // Draw arc:
            g.DrawArc(aPen, new Rectangle(170, 90, 100, 50), -90, 180);

            // Draw filled pie pieces
            g.FillPie(aBrush, new Rectangle(170, 160, 100, 100), -90, 90);
            g.FillPie(hBrush4, new Rectangle(170, 160, 100, 100), -90, -90);

            // Create pens.
            Pen redPen   = new Pen(Color.Red, 3);
            Pen greenPen = new Pen(Color.Green, 3);
            greenPen.DashStyle = DashStyle.DashDotDot;
            SolidBrush transparentBrush = new SolidBrush(Color.FromArgb(150, Color.Wheat));

            // define point array to draw a curve:
            Point point1 = new Point(300, 250);
            Point point2 = new Point(350, 125);
            Point point3 = new Point(400, 110);
            Point point4 = new Point(450, 210);
            Point point5 = new Point(500, 300);
            Point[] curvePoints ={ point1, point2, point3, point4, point5};

            // Draw lines between original points to screen.
            g.DrawLines(redPen, curvePoints);

            // Fill Curve
            g.FillClosedCurve(transparentBrush, curvePoints);

            // Draw closed curve to screen.
            g.DrawClosedCurve(greenPen, curvePoints);

            g.Dispose();
        }
开发者ID:stnk3000,项目名称:sysdrawing-coregraphics,代码行数:55,代码来源:DrawingView.cs

示例4: FillRoundedRectangle

 public static void FillRoundedRectangle(Graphics g, Rectangle r, int d, Brush b)
 {
     SmoothingMode mode = g.SmoothingMode;
     g.SmoothingMode = SmoothingMode.HighSpeed;
     g.FillPie(b, r.X, r.Y, d, d, 180, 90);
     g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90);
     g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90);
     g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90);
     g.FillRectangle(b, r.X + d / 2, r.Y, r.Width - d, d / 2);
     g.FillRectangle(b, r.X, r.Y + d / 2, r.Width, r.Height - d);
     g.FillRectangle(b, r.X + d / 2, r.Y + r.Height - d / 2, r.Width - d, d / 2);
     g.SmoothingMode = mode;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:13,代码来源:Filters.cs

示例5: RepertoryImage

        public static void RepertoryImage(Graphics drawDestination)
        {
            if (mMscStyle==MscStyle.UML2){
                StringFormat itemStringFormat = new StringFormat();
                RectangleF itemBox = new RectangleF(5, 20, 30, 15);
                itemStringFormat.Alignment = StringAlignment.Near;
                itemStringFormat.LineAlignment = StringAlignment.Near;
                PointF[] statePolygon = new PointF[5];
                statePolygon[0] = new PointF(5,20);
                statePolygon[1] = new PointF(40,20);
                statePolygon[2] = new PointF(40,30);
                statePolygon[3] = new PointF(35,35);
                statePolygon[4] = new PointF(5,35);
                drawDestination.FillRectangle(Brushes.White,5,20,70,40);
                drawDestination.DrawString("ref",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
                drawDestination.DrawPolygon(Pens.Black,statePolygon);
                itemBox = new RectangleF(5, 30, 70, 30);
                itemStringFormat.Alignment = StringAlignment.Center;
                itemStringFormat.LineAlignment = StringAlignment.Center;
                drawDestination.DrawString("Reference",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
                drawDestination.DrawRectangle(Pens.Black,5,20,70,40);
                itemStringFormat.Dispose();
            }
            else if (mMscStyle==MscStyle.SDL){
                StringFormat itemStringFormat = new StringFormat();
                RectangleF itemBox = new RectangleF(10, 25, 60, 30);
                itemStringFormat.Alignment = StringAlignment.Center;
                itemStringFormat.LineAlignment = StringAlignment.Center;

                drawDestination.FillPie(Brushes.White,5,20,10,10,180,90);
                drawDestination.FillPie(Brushes.White,5,50,10,10,90,90);
                drawDestination.FillPie(Brushes.White,65,20,10,10,270,90);
                drawDestination.FillPie(Brushes.White,65,50,10,10,0,90);

                drawDestination.FillRectangle(Brushes.White, 5, 25, 5, 30);
                drawDestination.FillRectangle(Brushes.White, 70, 25, 5, 30);
                drawDestination.FillRectangle(Brushes.White, 10, 20, 60, 40);

                drawDestination.DrawLine(Pens.Black,10,20,70,20);
                drawDestination.DrawLine(Pens.Black,5,25,5,55);
                drawDestination.DrawLine(Pens.Black,10,60,70,60);
                drawDestination.DrawLine(Pens.Black,75,25,75,55);

                drawDestination.DrawArc(Pens.Black,5,20,10,10,180,90);
                drawDestination.DrawArc(Pens.Black,5,50,10,10,90,90);
                drawDestination.DrawArc(Pens.Black,65,20,10,10,270,90);
                drawDestination.DrawArc(Pens.Black,65,50,10,10,0,90);

                drawDestination.DrawString("Reference",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat);
            }
        }
开发者ID:xueliu,项目名称:MSC_Generator,代码行数:51,代码来源:ReferenceExtension.cs

示例6: DrawSign

        //##################################################################################

        public virtual void DrawSign(Graphics g, Font font, string sign, int x, int y)
        {
            var boxSize = TextRenderer.MeasureText(sign, font);
            int boxWidth = boxSize.Width + 4;
            int boxHeight = boxSize.Height + 8;

            g.FillPie(Brushes.SandyBrown,
                x - 16,
                y - 14,
                32,
                28,
                270 - 20,
                40);

            g.FillRectangle(Brushes.SandyBrown,
                x - boxWidth / 2,
                y - boxHeight - 8,
                boxWidth,
                boxHeight);

            g.DrawString(sign, font, Brushes.Black,
                x,
                y - boxHeight - 4,
                new StringFormat()
                {
                    Alignment = StringAlignment.Center
                });
        }
开发者ID:NeuroWhAI,项目名称:ClickWar,代码行数:30,代码来源:ModelGraphic.cs

示例7: OnRender

            public override void OnRender(Graphics g)
            {
                base.OnRender(g);

                if (wprad == 0 || Overlay.Control == null)
                    return;

                // if we have drawn it, then keep that color
                if (!initcolor.HasValue)
                    Color = Color.White;

                //wprad = 300;

                // undo autochange in mouse over
                //if (Pen.Color == Color.Blue)
                //  Pen.Color = Color.White;

                double width = (Overlay.Control.MapProvider.Projection.GetDistance(Overlay.Control.FromLocalToLatLng(0, 0), Overlay.Control.FromLocalToLatLng(Overlay.Control.Width, 0)) * 1000.0);
                double height = (Overlay.Control.MapProvider.Projection.GetDistance(Overlay.Control.FromLocalToLatLng(0, 0), Overlay.Control.FromLocalToLatLng(Overlay.Control.Height, 0)) * 1000.0);
                double m2pixelwidth = Overlay.Control.Width / width;
                double m2pixelheight = Overlay.Control.Height / height;

                GPoint loc = new GPoint((int)(LocalPosition.X - (m2pixelwidth * wprad * 2)), LocalPosition.Y);// MainMap.FromLatLngToLocal(wpradposition);

                //if (m2pixelheight > 0.5)
                    g.DrawArc(Pen, new System.Drawing.Rectangle(LocalPosition.X - Offset.X - (int)(Math.Abs(loc.X - LocalPosition.X) / 2), LocalPosition.Y - Offset.Y - (int)Math.Abs(loc.X - LocalPosition.X) / 2, (int)Math.Abs(loc.X - LocalPosition.X), (int)Math.Abs(loc.X - LocalPosition.X)), 0, 360);

                    g.FillPie(new SolidBrush(Color.FromArgb(25,Color.Red)), LocalPosition.X - Offset.X - (int)(Math.Abs(loc.X - LocalPosition.X) / 2), LocalPosition.Y - Offset.Y - (int)Math.Abs(loc.X - LocalPosition.X) / 2,  Math.Abs(loc.X - LocalPosition.X), Math.Abs(loc.X - LocalPosition.X), 0, 360);

            }
开发者ID:jank3,项目名称:MissionPlanner,代码行数:30,代码来源:GMapMarkerAirport.cs

示例8: Draw

 public override void Draw(Graphics g, Tank t)
 {
     double ang1 = t.orientation + angleWithBase - viewAngle / 2;
     double ang2 = t.orientation + angleWithBase + viewAngle / 2;
     g.FillPie(new SolidBrush(Color.FromArgb(drawAlpha, color))
         , (int)t.pos.X - maxViewDistance, (int)t.pos.Y - maxViewDistance
         , 2 * maxViewDistance, 2 * maxViewDistance, (int)ang1, (int)ang2);
 }
开发者ID:samedcildir,项目名称:Tanks,代码行数:8,代码来源:Radar.cs

示例9: onManagedDraw

        public void onManagedDraw(Graphics graphics)
        {
            float angle;
            if (this.shotCount < this.ShotCount) {
                angle = this.secondsElapsed >= this.ShotTime ? 360 : 360 * this.secondsElapsed / this.ShotTime;
                graphics.FillPie (Brushes.Silver, Options.CameraWidth / 2 - 100, 0, 200, 200, 0, angle);
            } else {
                if (this.RechargeTime != 0) {
                    angle = 360 * this.secondsElapsed / this.RechargeTime;
                    graphics.FillPie (Brushes.Black, Options.CameraWidth / 2 - 100, 0, 200, 200, 0, angle);
                }
            }

            graphics.DrawEllipse (Pens.Black, Options.CameraWidth / 2 - 100, 0, 200, 200);

            for (int i = 0; i < this.bullets.Count; ++i) {
                this.bullets [i].onManagedDraw (graphics);
            }
        }
开发者ID:kotavi,项目名称:sandbox,代码行数:19,代码来源:Weapon.cs

示例10: Draw

 public override void Draw(Graphics g, Rectangle r, Brush bg, Brush fg, uint seed, bool fliphorizontal)
 {
     switch ((seed + (fliphorizontal ? 2 : 0)) % 4)
     {
         case 0: //  ◞
             g.FillPie(fg, new Rectangle(r.Left - r.Width, r.Top - r.Height, r.Width * 2, r.Height * 2), 0, 90);
             break;
         case 1: //  ◜
             g.FillPie(fg, new Rectangle(r.Left, r.Top, r.Width * 2, r.Height * 2), -90, -90);
             break;
         case 2: //  ◟
             g.FillPie(fg, new Rectangle(r.Left, r.Top - r.Height, r.Width * 2, r.Height * 2), 90, 90);
             break;
         case 3: //  ◝
         default:
             g.FillPie(fg, new Rectangle(r.Left - r.Width, r.Top, r.Width * 2, r.Height * 2), 0, -90);
             break;
     }
 }
开发者ID:RobThree,项目名称:NIdenticon,代码行数:19,代码来源:PieGenerator.cs

示例11: Draw

 public override void Draw(Graphics g)
 {
     Pen pen = new Pen(Brushes.Black,3);
        UpdateBounds();
        g.FillEllipse(Brushes.Red, X,Y, 10, 10);
        g.DrawEllipse(pen, X - 3, Y - 3, 13, 13);
        g.FillPie(Brushes.White,X,Y, 10, 10, 0, 180);
        g.DrawEllipse(pen, X + 3, Y + 3, 2, 2);
     Y = Y - BallInterval;
 }
开发者ID:KristijanLaskovski,项目名称:Pokemon2014,代码行数:10,代码来源:Pokeball.cs

示例12: Render

 public void Render(Graphics graphics)
 {
     graphics.FillPie(
         _brush,
         _rectangle.X,
         _rectangle.Y,
         _rectangle.Width,
         _rectangle.Height,
         _startAngle,
         _endAngle);
 }
开发者ID:Doozie7,项目名称:TaskClerkDesktop,代码行数:11,代码来源:FillPie.cs

示例13: DrawOn

 public void DrawOn(Graphics graphics)
 {
     if (_flag == true)
     {
         graphics.FillPie(_brush, _center.X - _radius, _center.Y - _radius, _diameter, _diameter, _floatStartAngle,
                         _floatArcAngle);
     }
     else
     {
         graphics.DrawArc(_pen, _center.X - _radius, _center.Y - _radius, _diameter, _diameter, 0, 360);
     }
 }
开发者ID:Meowse,项目名称:SpectrumChapeau,代码行数:12,代码来源:DrawCircleAction.cs

示例14: DrawGlowCorner

		private void DrawGlowCorner(Graphics g)
		{
			using (var graphicsPath = new GraphicsPath())
			using (var graphicsPath2 = new GraphicsPath())
			{
				var rect = new Rectangle(-GlowSize, -1, GlowSize * 2, GlowSize * 2);
				var rect2 = new Rectangle(-GlowSize, Owner.Height, GlowSize * 2, GlowSize * 2);
				graphicsPath.AddEllipse(rect);
				graphicsPath2.AddEllipse(rect2);
				using (var pathGradientBrush = new PathGradientBrush(graphicsPath))
				using (var pathGradientBrush2 = new PathGradientBrush(graphicsPath2))
				{
					pathGradientBrush.CenterColor = GlowAlphaColor;
					pathGradientBrush.SurroundColors = new[] { Color.Transparent, Color.Transparent, Color.Transparent, Color.Transparent };
					pathGradientBrush2.CenterColor = GlowAlphaColor;
					pathGradientBrush2.SurroundColors = new[] { Color.Transparent, Color.Transparent, Color.Transparent, Color.Transparent };
					g.FillPie(pathGradientBrush, rect, 270, 90);
					g.FillPie(pathGradientBrush2, rect2, 0, 90);
				}
			}
		}
开发者ID:shinji3,项目名称:PeerstPlayer,代码行数:21,代码来源:GlowRight.cs

示例15: Dibujar_Diente

        public void Dibujar_Diente()
        {
            Bitmap area_de_dibujo = new Bitmap(pictureBox.Width, pictureBox.Height);
            g = Graphics.FromImage(area_de_dibujo);
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;

            g.FillPie(new SolidBrush(colores_partes[1]), 0, 0, 40, 40, 225, 90);
            g.FillPie(new SolidBrush(colores_partes[2]), 0, 0, 40, 40, -45, 90);
            g.FillPie(new SolidBrush(colores_partes[3]), 0, 0, 40, 40, 45, 90);
            g.FillPie(new SolidBrush(colores_partes[4]), 0, 0, 40, 40, 135, 90);

            Pen p = new Pen(Color.Black);

            g.DrawPie(p, 0, 0, 40, 40, 225, 90);
            g.DrawPie(p, 0, 0, 40, 40, -45, 90);
            g.DrawPie(p, 0, 0, 40, 40, 45, 90);
            g.DrawPie(p, 0, 0, 40, 40, 135, 90);

            g.FillEllipse(new SolidBrush(colores_partes[0]), 11.5f, 11.5f, 17f, 17f);
            g.DrawEllipse(Pens.Black, 11.5f, 11.5f, 17.0f, 17.0f);

            pictureBox.Image = area_de_dibujo;
        }
开发者ID:wantonio,项目名称:Prueba,代码行数:23,代码来源:diente.cs


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