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

DrawArc() public method

public DrawArc ( Pen pen, Rectangle rect, float startAngle, float sweepAngle ) : void
pen Pen
rect Rectangle
startAngle float
sweepAngle float
return void
        public void DrawArc(Pen pen, Rectangle rect, float startAngle, float sweepAngle)
        {
            DrawArc (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
        }

Same methods

Graphics::DrawArc ( Pen pen, RectangleF rect, float startAngle, float sweepAngle ) : void
Graphics::DrawArc ( Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle ) : void
Graphics::DrawArc ( Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle ) : void

Usage Example

        /// <summary>
        /// Draw rectangle
        /// </summary>
        /// <param name="g"></param>
        public override void Draw(Graphics g)
        {
            Pen pen = new Pen(Color, PenWidth);

            Rectangle _rect = new Rectangle();
            _rect = DrawRectangle.GetNormalizedRectangle(Rectangle);

            int x = _rect.X;
            int y = _rect.Y;
            int w = _rect.Width;
            int h = _rect.Height;
            int hElipse = (w/5);
            int hArco = hElipse / 2;
            int hReta = h - hArco;

            // g.DrawArc(pen, DrawRectangle.GetNormalizedRectangle(Rectangle), -270, 180);
            g.DrawArc(pen, x, y, w, hElipse, 0, 360);
            g.DrawArc(pen, x, y + hReta - hArco , w, hElipse, 360, 180);

            Point SE = new Point(x, y + hArco);             //SuperiorEsquerdo
            Point IE = new Point(x, y + hReta);     //InferioriEsquerdo

            Point SD = new Point(x + w, y + hArco);         //SuperiorDireito
            Point ID = new Point(x + w, y + hReta); //InferiorDireito

            g.DrawLine(pen, SE, IE);
            g.DrawLine(pen, SD, ID);

            //g.DrawRectangle(pen, x, y, w, h);

            pen.Dispose();
        }
All Usage Examples Of System.Drawing.Graphics::DrawArc