Graphics.DrawEllipse(Pen物件, X1, Y1, W, H)
Graphics.DrawEllipse(Pen物件, X1, Y1, X2 - X1, Y2 - Y1)
Graphics.FillEllipse(Brushes物件, X1, Y1, W, H)
Graphics.FillEllipse(Brushes物件, X1, Y1, X2 - X1, Y2 - Y1)
[ VB2010 ] - 繪製圓形
(長與寬相同的橢圓形):
Public Class Form1
Dim Painting As Bitmap
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Painting = New Bitmap(400, 400)
Dim G As Graphics = Graphics.FromImage(Painting)
Dim ind As Integer
G.FillEllipse(Brushes.Purple, 0, 0, 200, 200)
For ind = 0 To 15 Step 1
G.DrawEllipse(Pens.Blue, 20 + 20 * ind, 10 + 10 * ind, 40, 20)
Next ind
Me.BackgroundImageLayout = ImageLayout.None
Me.BackgroundImage = Painting
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
沒有留言:
張貼留言