C#winform picturebox形状变成圆形_重绘-默认是长方形

C#winform picturebox形状变成圆形_重绘-默认是长方形

private void Form1_Load(object sender, EventArgs e)
        {
            //GraphicsPath gp = new GraphicsPath();
            //gp.AddEllipse(this.ClientRectangle);
            //Region region = new Region(gp);
            //this.Region = region;
            //gp.Dispose();
            //region.Dispose();
            //base.OnCreateControl();

           

                GraphicsPath gp = new GraphicsPath();

                gp.AddEllipse(pictureBox2.ClientRectangle);

                Region region = new Region(gp);

                pictureBox2.Region = region;

                gp.Dispose();

                region.Dispose();

          



        }
欢迎讨论,相互学习。 txwtech@163.com
原文地址:https://www.cnblogs.com/txwtech/p/15371332.html