Tutorial Programming

Tutorial basic, Visual Studio VB.NET 2013 Pengunaan Graphics Polygon dan Pie


Hallo sahabat saya akan menjelaskan Pengunaan Graphics Polygon dan Pie pada visual studio 2013, oke langsung aja


Triangle



Private Sub BtnDraw_Click(sender As Object, e As EventArgs) Handles BtnDraw.Click
Dim myPen As Pen
Dim A As New Point(10, 10)
Dim B As New Point(100, 50)
Dim C As New Point(60, 150)
Dim myPoints As Point() = {A, B, C}
myPen = New Pen(Drawing.Color.Blue, 5)
Dim myGraphics As Graphics = Me.CreateGraphics
myGraphics.DrawPolygon(myPen, myPoints)
End Sub







Quadrilateral




Private Sub BtnDraw_Click(sender As Object, e As EventArgs) Handles BtnDraw.Click
Dim myPen As Pen Dim A As New Point(10, 10)
Dim B As New Point(100, 50)
Dim C As New Point(120, 150)
Dim D As New Point(60, 200)
Dim myPoints As Point() = {A, B, C, D}
myPen = New Pen(Drawing.Color.Blue, 5)
Dim myGraphics As Graphics = Me.CreateGraphics
myGraphics.DrawPolygon(myPen, myPoints)
End Sub




Pie




Private Sub BtnDraw_Click(sender As Object, e As EventArgs) Handles BtnDraw.Click
Dim myPen As Pen myPen = New Pen(Drawing.Color.Blue, 5)
Dim myGraphics As Graphics = Me.CreateGraphics
myGraphics.DrawPie(myPen, 50,50, 150,150,0,60)
End Sub




Sekian tutorial saya sahabat semoga bermanfaat yah.

No comments:

Post a Comment

Tutorial Programming Designed by Templateism | Ary EJFA Copyright © 2015

Theme images by richcano. Powered by Blogger.