在VB.Net中如何画实心的圆
答案:4 悬赏:30 手机版
解决时间 2021-02-24 14:15
- 提问者网友:一抹荒凉废墟
- 2021-02-23 23:46
在VB.Net中如何画实心的圆
最佳答案
- 五星知识达人网友:往事隔山水
- 2021-02-24 00:39
在PictureBox1上画红色的实心圆:
Private Sub DrawCircle(ByVal cp As Point, ByVal radius As Integer, ByVal color As Brush)
Dim gr As Graphics
gr = PictureBox1.CreateGraphics
Dim rect As Rectangle = New Rectangle(cp.X - radius, cp.Y - radius, 2 * radius, 2 * radius)
gr.DrawEllipse(Pens.Black, rect)
gr.FillEllipse(color, rect)
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
DrawCircle(New Point(120, 100), 80, Brushes.Red)
End Sub
Private Sub DrawCircle(ByVal cp As Point, ByVal radius As Integer, ByVal color As Brush)
Dim gr As Graphics
gr = PictureBox1.CreateGraphics
Dim rect As Rectangle = New Rectangle(cp.X - radius, cp.Y - radius, 2 * radius, 2 * radius)
gr.DrawEllipse(Pens.Black, rect)
gr.FillEllipse(color, rect)
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
DrawCircle(New Point(120, 100), 80, Brushes.Red)
End Sub
全部回答
- 1楼网友:由着我着迷
- 2021-02-24 03:21
去玩儿体育【【
- 2楼网友:琴狂剑也妄
- 2021-02-24 02:46
先画圆,后涂色
- 3楼网友:鱼忧
- 2021-02-24 01:41
Dim myBitmap As New Bitmap(640, 480)
Dim myGraphic As Graphics = Graphics.FromBitmap(myBitmap)
with mygraphic
.DrawImage....
.Drawline...
end with
PictureBox.Image=myBitmap
Dim myGraphic As Graphics = Graphics.FromBitmap(myBitmap)
with mygraphic
.DrawImage....
.Drawline...
end with
PictureBox.Image=myBitmap
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯