Visual Basic ile Grafik

Report
Visual Basic ile Grafik
Grafik Nesneler
DrawArc
Yay çizer
DrawBezier
Kübik kapalı eğri çizer
DrawBeziers
Kübik kapalı eğriler serisi çizer
DrawClosedCurve Tanımlanan dizi noktaları kullanılarak kapalı eğriler çizer
DrawCurve
Tanımlanan dizi noktaları kullanılarak eğriler çizer
DrawEllipse
Elips veya Çember çizer
DrawImage
Bir nesne çizer(resim)
DrawLine
Çizgi çizer
DrawPath
GraphicsPath tarafından belirlenen eğri ve çizgiler çizer
DrawPie
Pasta dilimi çizer
DrawPolygon
Bir poligon çokgen çizer
DrawRectangle Dikdörtgen çizer
DrawString
Metin çizer
Grafik Nesneler
FillEllipse
FillPath
FillPie
FillPolygon
FillRectangle
FillRectangles
FillRegion
Sınırları belirlenmiş bir elipsin içini boyar
Belirlenen yolun içini boyar
Pasta diliminin içini boyar
Dizi noktaları tarafından belirlenmiş çokgenin içini boyar
Dikdörtgenin içini boyar
Dikdörtgenler serisinin içini boyar
Bir bölgenin içini boyar
DrawLine
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
Dim pn As New Pen(Color.Blue, 5)
Dim pnt1 As New Point(10, 10)
Dim pnt2 As New Point(100, 100)
g.DrawLine(pn, pnt1, pnt2)
End Sub
DrawEllipse
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
Dim pen As New Drawing.Pen(System.Drawing.Color.Red, 5)
Me.CreateGraphics.DrawEllipse(pen, 10, 10, 100, 100)
pen.Dispose()
End Sub
DrawString
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
Dim pen As New Drawing.Pen(System.Drawing.Color.Red, 5)
Me.CreateGraphics.DrawEllipse(pen, 10, 10, 100, 100)
pen.Dispose()
Me.CreateGraphics.DrawString("Şekil ismi", New Font("Arial", 12,
FontStyle.Bold.Underline), Brushes.Black, 12, 50)
End Sub
DrawPie
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
Dim pen As New Drawing.Pen(System.Drawing.Color.Red, 5)
Me.CreateGraphics.DrawPie(pen, 5, 5, 200, 200, 0, -90)
pen.Dispose()
Me.CreateGraphics.DrawString("Yay", New Font("Arial", 12,
FontStyle.Bold.Underline), Brushes.Black, 110, 50)
End Sub
MouseUp
Mouse ile tıklanan yere çember çizimi :
Protected Overrides Sub OnMouseUp(ByVal e As
System.Windows.Forms.MouseEventArgs)
Dim pen As New Drawing.Pen(System.Drawing.Color.Red, 5)
Me.CreateGraphics.DrawEllipse(pen, e.X, e.Y, 50, 50)
Me.CreateGraphics.DrawEllipse(pen, e.X-25, e.Y-25, 50, 50)
pen.Dispose()
End Sub
HatchBrush, FillRectangle
Imports System.Drawing.Drawing2D
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
Dim g As Graphics = e.Graphics
Dim firca1 As New HatchBrush(HatchStyle.DarkHorizontal, Color.Tomato)
Dim alan1 As New Rectangle(0, 0, Me.Width, 50)
g.FillRectangle(firca1, alan1)
End Sub

similar documents