在VB.Net中如何画实心的圆 5
展开全部
在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
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
先画圆,后涂色
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询