Private Sub PictureBox1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint e.Graphics.DrawEllipse(Pens.AliceBlue, New Rectangle(New Point(0, 0), New Size(PictureBox1.Width, Picture
Private Sub PictureBox1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint e.Graphics.DrawEllipse(Pens.AliceBlue, New Rectangle(New Point(0, 0), New Size(PictureBox1.Width, PictureBox1.Height))) End Sub
我想在VB.Net,.Net版本4中绘制一个圆圈.
没有任何东西出现在paintbox中.
e.Graphics.DrawEllipse(Pens.AliceBlue,e.ClipRectangle);
它对我有用.
您也可以尝试使用:
e.Graphics.DrawEllipse( Pens.AliceBlue, 0, 0, pictureBox1.Width-1, pictureBox1.Height-1);
要么
Rectangle rect = e.ClipRectangle; rect.Inflate(-1, -1); e.Graphics.DrawEllipse(Pens.AliceBlue, rect);