2017年12月11日 星期一

[ VB2010 ] - 繪製橢圓形 - 繪製圓形

[ VB2010 ] - 繪製橢圓形


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

沒有留言:

張貼留言

DHT11 (Node-Red) +PostgreSQL 模擬

 DHT11 (Node-Red) +PostgreSQL 模擬 [{"id":"acddd911a6412f0a","type":"inject","z":"08dc4...