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(); }
欢迎讨论,相互学习。
cdtxw@foxmail.com