加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-17 07:18:22 所属栏目:百科 来源:网络整理
导读: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
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,pictureBox1.Width-1,pictureBox1.Height-1);

要么

Rectangle rect = e.ClipRectangle;
rect.Inflate(-1,-1);
e.Graphics.DrawEllipse(Pens.AliceBlue,rect);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读