How to draw this image using GDI+

Could you show me the way to draw following image by using GDI+ Thank you very much.



Answer this question

How to draw this image using GDI+

  • dtlinker

    Thank you very much. It works well.
  • n_jagan

    You need to use the Graphics.DrawPie and Graphics.FillPie method to draw a pie.
    Here is a little example:


    public void FillPieInt(PaintEventArgs e)
    {

    // Create solid brush.
    SolidBrush redBrush = new SolidBrush(Color.Red);

    // Create location and size of ellipse.
    int x = 0;
    int y = 0;
    int width = 200;
    int height = 100;

    // Create start and sweep angles.
    int startAngle = 0;
    int sweepAngle = 45;

    // Fill pie to screen.
    e.Graphics.FillPie(redBrush, x, y, width, height, startAngle, sweepAngle);
    }





  • How to draw this image using GDI+