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

沒有留言:

張貼留言

2024產專班 作業2

 2024產專班 作業2   1. 系統圖       ESP32+MFRC522 組成RFID Reader 可以將RFID卡片的UID 透過 MQTT協定    上傳(發行 主題 (:topic) alex9ufo/2024/RFID/RFID_UID  ,, Payload...