Membuat Drawing Functions dengan VB.NET

Drawing Functions : Tutorial Drawing Basic Shapes, Drawing Draw Rectangle, DrawEllipse, DrawPolygon, DrawPie, DrawLines, FillRectangle, dan FillPolygon methode VB.NET

Drawing Basic Shapes Vb.NET - Tutorial belajar visual basic net / vb.net kali ini tentang bagaimana cara membuat Drawing menggunakan vb.net khusus pemula, Sector code disini akan menjelaskan secara detail Penggunaan Drawing ini, pembelajaran ini dimulai dari membuat drawLine, DrawEllipse, DrawRectangle, DrawArc, DrawPolygon, DrawPie, DrawBezier.

Membuat DrawingVb.NET

Kita akan membuat project baru dengan nama "DrawingVbNet", desainlah tampilan form kamu kurang lebih hasilnya akan seperti gambar berikut :
Langsung saja kita membuat code untuk drawingnya ya..

DrawingLine VB.NET

Pada class form1 deklarasikan class drawing grapihics dan drawing pen yang nanti akan kita gunakan diseluruh button.
    Dim CreateGrapics As  _
    System.Drawing.Graphics
    Dim CreatePen As _
    New System.Drawing.Pen(Color.Blue, 2)
Code DrawingLine
    Private Sub Button1_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button1.Click
        Dim x1 As Integer = 10
        Dim x2 As Integer = 80
        Dim x3 As Integer = 280
        Dim x4 As Integer = 80
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawLine(CreatePen, _
        x1, x2, x3, x4)
    End Sub

Code DrawEllipse

    Private Sub Button2_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button2.Click
        Dim x1 As Integer = 50
        Dim x2 As Integer = 50
        Dim x3 As Integer = 100
        Dim x4 As Integer = 150
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawEllipse(CreatePen, _
        x1, x2, x3, x4)
    End Sub

Code DrawRectangle

    Private Sub Button3_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button3.Click
        Dim x1 As Integer = 30
        Dim x2 As Integer = 30
        Dim x3 As Integer = 50
        Dim x4 As Integer = 60
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawRectangle(CreatePen, _
        x1, x2, x3, x4)
    End Sub

Code DrawArc

    Private Sub Button4_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button4.Click
        Dim x1 As Integer = 20
        Dim x2 As Integer = 20
        Dim x3 As Integer = 100
        Dim x4 As Integer = 100
        Dim x5 As Integer = 150
        Dim x6 As Integer = 160
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawArc(CreatePen, _
        x1, x2, x3, x4, x5, x6)
    End Sub

Code DrawPie

    Private Sub Button5_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button5.Click
        Dim x1 As Integer = 50
        Dim x2 As Integer = 50
        Dim x3 As Integer = 150
        Dim x4 As Integer = 150
        Dim x5 As Integer = 0
        Dim x6 As Integer = 170
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawPie(CreatePen, _
        x1, x2, x3, x4, x5, x6)
    End Sub

Code DrawPolygon

    Private Sub Button6_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button6.Click
        Dim poly(5) As System.Drawing.Point
        poly(0).X = 0
        poly(0).Y = 0
        poly(1).X = 53
        poly(1).Y = 111
        poly(2).X = 114
        poly(2).Y = 86
        poly(3).X = 34
        poly(3).Y = 34
        poly(4).X = 165
        poly(4).Y = 7
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawPolygon(CreatePen, poly)
    End Sub

Code DrawBezier

    Private Sub Button7_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button7.Click
        Dim x1 As Integer = 100
        Dim x2 As Integer = 200
        Dim x3 As Integer = 240
        Dim x4 As Integer = 250
        Dim x5 As Integer = 100
        Dim x6 As Integer = 200
        Dim x7 As Integer = 150
        Dim x8 As Integer = 30
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawBezier(CreatePen, _
        100, 200, 240, 250, 100, 200, 150, 30)
    End Sub
sedangkan untuk code aplikasi drawing functions keseluruhan silahkan lihat seluruh code berikut :
Public Class Form1
    Dim CreateGrapics As  _
    System.Drawing.Graphics
    Dim CreatePen As _
    New System.Drawing.Pen(Color.Blue, 2)
    Private Sub Button1_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button1.Click
        Dim x1 As Integer = 10
        Dim x2 As Integer = 80
        Dim x3 As Integer = 280
        Dim x4 As Integer = 80
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawLine(CreatePen, _
        x1, x2, x3, x4)
    End Sub

    Private Sub Button2_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button2.Click
        Dim x1 As Integer = 50
        Dim x2 As Integer = 50
        Dim x3 As Integer = 100
        Dim x4 As Integer = 150
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawEllipse(CreatePen, _
        x1, x2, x3, x4)
    End Sub

    Private Sub Button3_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button3.Click
        Dim x1 As Integer = 30
        Dim x2 As Integer = 30
        Dim x3 As Integer = 50
        Dim x4 As Integer = 60
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawRectangle(CreatePen, _
        x1, x2, x3, x4)
    End Sub

    Private Sub Button4_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button4.Click
        Dim x1 As Integer = 20
        Dim x2 As Integer = 20
        Dim x3 As Integer = 100
        Dim x4 As Integer = 100
        Dim x5 As Integer = 150
        Dim x6 As Integer = 160
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawArc(CreatePen, _
        x1, x2, x3, x4, x5, x6)
    End Sub

    Private Sub Button5_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button5.Click
        Dim x1 As Integer = 50
        Dim x2 As Integer = 50
        Dim x3 As Integer = 150
        Dim x4 As Integer = 150
        Dim x5 As Integer = 0
        Dim x6 As Integer = 170
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawPie(CreatePen, _
        x1, x2, x3, x4, x5, x6)
    End Sub

    Private Sub Button6_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button6.Click
        Dim poly(5) As System.Drawing.Point
        poly(0).X = 0
        poly(0).Y = 0
        poly(1).X = 53
        poly(1).Y = 111
        poly(2).X = 114
        poly(2).Y = 86
        poly(3).X = 34
        poly(3).Y = 34
        poly(4).X = 165
        poly(4).Y = 7
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawPolygon(CreatePen, poly)
    End Sub

    Private Sub Button7_Click(sender _
        As System.Object, e As System.EventArgs) _
        Handles Button7.Click
        Dim x1 As Integer = 100
        Dim x2 As Integer = 200
        Dim x3 As Integer = 240
        Dim x4 As Integer = 250
        Dim x5 As Integer = 100
        Dim x6 As Integer = 200
        Dim x7 As Integer = 150
        Dim x8 As Integer = 30
        CreateGrapics = Me.CreateGraphics
        CreateGrapics.DrawBezier(CreatePen, _
        100, 200, 240, 250, 100, 200, 150, 30)
    End Sub
End Class
Silahkan share jika bermanfaat.

COMMENTS

Next Recomended


Feel free to code it up and send us a pull request.

Hi everyone, let's me know how much this lesson can help your work. Please Subscribe and Follow Our Social Media 'kodeajaib[dot]com' to get Latest tutorials and will be send to your email everyday for free!, Just hit a comment if you have confused. Nice to meet you and Happy coding :) all ^^



Follow by E-Mail


Name

ADO.NET,3,Ajax,6,Android,9,AngularJS,4,ASP.NET,4,Blogger Tutorials,7,Bootstrap,7,C++,1,Codeigniter,2,Cplusplus,6,Crystal Report,6,CSharp,25,Ebook Java,2,FlyExam,1,FSharp,3,Game Development,2,Java,35,JDBC,2,Laravel,84,Lumen,2,MariaDB,2,Ms Access,3,MySQL,31,ODBC,6,OleDB,1,PHP,14,PHP Framework,5,PHP MYSQLI,9,PHP OOP,5,Python,8,Python 3,4,SQL Server,4,SQLite,4,Uncategorized,5,Vb 6,2,Vb.Net,89,Video,48,Vue Js,4,WPF,2,Yii,3,
ltr
item
KODE AJAIB: Membuat Drawing Functions dengan VB.NET
Membuat Drawing Functions dengan VB.NET
Drawing Functions : Tutorial Drawing Basic Shapes, Drawing Draw Rectangle, DrawEllipse, DrawPolygon, DrawPie, DrawLines, FillRectangle, dan FillPolygon methode VB.NET
http://1.bp.blogspot.com/-nNMUe3qupfY/VkXM3UJJs-I/AAAAAAAABJw/quj9p-nLxl4/s320/drawing-vb-net.png
http://1.bp.blogspot.com/-nNMUe3qupfY/VkXM3UJJs-I/AAAAAAAABJw/quj9p-nLxl4/s72-c/drawing-vb-net.png
KODE AJAIB
https://www.kodeajaib.com/2015/11/membuat-drawing-functions-dengan-vbnet.html
https://www.kodeajaib.com/
https://www.kodeajaib.com/
https://www.kodeajaib.com/2015/11/membuat-drawing-functions-dengan-vbnet.html
true
3214704946184383982
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy