PictureBox PaintEvent with other method

后端 未结 2 913
天命终不由人
天命终不由人 2020-11-22 16:34

There is only one picturebox in my form and I want to drawcircle with a method on this picturebox but I cant do that and not working.The method is:

private B         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 17:25

    private static void DrawCircle(Graphics gfx)
    {    
        SolidBrush firca_dis = new SolidBrush(Color.FromArgb(192, 0, 192));
        Rectangle rec = new Rectangle(0, 0, 40, 40); //Size and location of the Circle
    
        gfx.FillEllipse(firca_dis, rec); //Draw a Circle and fill it
        gfx.DrawEllipse(new Pen(firca_dis), rec); //draw a the border of the cicle your choice
    }
    

提交回复
热议问题