当前位置 : 主页 > 编程语言 > c语言 >

我想在VB.Net中画一个圆圈

来源:互联网 收集:自由互联 发布时间:2021-06-24
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);
网友评论