以椭圆形显示图像

实现效果:

  

知识运用:

  Graphics类的FillEllipse方法    //用来填充Rectangle结构指定的边框所定义的椭圆的内部

  public void FillEllipse (Brush brush, Rectangle rect)

实现代码:

        private void button2_Click(object sender, EventArgs e)
        {
            this.panel1.Refresh();                              //刷新Panel控件
            Graphics graphics = this.panel1.CreateGraphics();   //创建绘图对象
            TextureBrush brush = new TextureBrush(myImage);     //创建TextureBrush对象
            graphics.FillEllipse(brush,this.panel1.ClientRectangle);    //绘制椭圆对象
        }

  

原文地址:https://www.cnblogs.com/feiyucha/p/10263549.html