System.Drawing.Graphics.FillPie C# (CSharp) Method

FillPie() public method

public FillPie ( Brush brush, Rectangle rect, float startAngle, float sweepAngle ) : void
brush Brush
rect Rectangle
startAngle float
sweepAngle float
return void
        public void FillPie(Brush brush, Rectangle rect, float startAngle, float sweepAngle)
        {
            if (brush == null)
                throw new ArgumentNullException ("brush");
            DrawEllipticalArc(rect, startAngle, sweepAngle, true);
            FillBrush(brush);
        }

Same methods

Graphics::FillPie ( Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle ) : void
Graphics::FillPie ( Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle ) : void

Usage Example

Example #1
0
 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);
         }
     }
 }
All Usage Examples Of System.Drawing.Graphics::FillPie