Tutorial Programming

Tutorial basic, Visual Studio VB.NET 2013 Pengunaan Graphics Filling Shapes dengan Color


Hallo sahabat saya akan menjelaskan Pengunaan Graphics Filling Shapes dengan Color pada visual studio 2013, oke langsung aja




Private Sub BtnDraw_Click(sender As Object, e As EventArgs) Handles BtnDraw.ClickDim myPen As Pen
Dim myBrush As Brush
Dim myGraphics As Graphics = Me.CreateGraphicsmyPen = New Pen(Drawing.Color.Blue, 5)
myBrush = New SolidBrush(Color.Coral)
myGraphics.DrawRectangle(myPen, 65, 50, 150, 150)
myGraphics.FillRectangle(myBrush, 65, 50, 150, 150)
End Sub






Private Sub BtnDraw_Click(sender As Object, e As EventArgs) Handles BtnDraw.ClickDim myPen As Pen
Dim myBrush As Brush
Dim myGraphics As Graphics = Me.CreateGraphicsmyPen = New Pen(Drawing.Color.Blue, 5)
myBrush = New SolidBrush(Color.Coral)
myGraphics.DrawEllipse(myPen, 50, 50, 180, 100)
myGraphics.FillEllipse(myBrush, 50, 50, 180, 100)
End Sub






Private Sub BtnDraw_Click(sender As Object, e As EventArgs) Handles BtnDraw.Click
Dim myPen As Pen
Dim myBrush As Brush
Dim A As New Point(70, 10)
Dim B As New Point(170, 50)
Dim C As New Point(200, 150)
Dim D As New Point(140, 200)
Dim myPoints As Point() = {A, B, C, D}
myPen = New Pen(Drawing.Color.Blue, 5)
myBrush = New SolidBrush(Color.Coral)
Dim myGraphics As Graphics = Me.CreateGraphics
myGraphics.DrawPolygon(myPen, myPoints)
myGraphics.FillPolygon(myBrush, myPoints)
End Sub








Private Sub BtnDraw_Click(sender As Object, e As EventArgs) Handles BtnDraw.Click
Dim myPen As Pen
Dim myBrush As Brush
Dim myGraphics As Graphics = Me.CreateGraphics
myPen = New Pen(Drawing.Color.Blue, 5)
myBrush = New SolidBrush(Color.Coral)
myGraphics.DrawPie(myPen, 30, 40, 150, 150, 0, 60)
myGraphics.FillPie(myBrush, 30, 40, 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.