c#windows 应用程序picturebox形状怎样变成圆形

时间:2021-02-23 20:38:32

        using System.Drawing.Drawing2D;
        private void button1_Click(object sender, EventArgs e)
        {
            GraphicsPath gp = new GraphicsPath();
            gp.AddEllipse(pictureBox1.ClientRectangle);
            Region region = new Region(gp);
            pictureBox1.Region = region;

            pictureBox2.Region=region;

            pictureBox3.Region=region;
            gp.Dispose();
            region.Dispose();
        }