List all Hatch styles : HatchBrush « 2D Graphics « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » 2D Graphics » HatchBrush 
17.63.2.List all Hatch styles
List all Hatch styles
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms

public class HatchStyle
   public Shared Sub Main
        Application.Run(New Form1)
   End Sub
End class

public class Form1
  Inherits System.Windows.Forms.Form

  Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
        Dim As Integer = 10
        Dim As Integer = 20

        
        e.Graphics.Clear(Me.BackColor)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.BackwardDiagonal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Cross)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DarkDownwardDiagonal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DarkHorizontal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DarkUpwardDiagonal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DarkVertical)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DashedDownwardDiagonal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DashedHorizontal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DashedUpwardDiagonal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DashedVertical)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DiagonalBrick)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DiagonalCross)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Divot)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DottedDiamond)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.DottedGrid)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.ForwardDiagonal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Horizontal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.HorizontalBrick)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.LargeCheckerBoard)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.LargeConfetti)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.LargeGrid)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.LightDownwardDiagonal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.LightHorizontal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.LightUpwardDiagonal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.LightVertical)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.NarrowHorizontal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.NarrowVertical)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.OutlinedDiamond)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent05)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent10)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent20)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent25)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent30)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent40)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent50)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent60)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent70)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent75)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent80)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Percent90)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Plaid)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Shingle)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.SmallCheckerBoard)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.SmallConfetti)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.SmallGrid)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.SolidDiamond)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Sphere)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Trellis)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Vertical)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Wave)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.Weave)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.WideDownwardDiagonal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.WideUpwardDiagonal)
        DrawSample(e.Graphics, x, y, Drawing2D.HatchStyle.ZigZag)
    End Sub

    Private Sub DrawSample(ByVal gr As Graphics, ByRef x As Integer, ByRef y As Integer, ByVal hatch_style As Drawing2D.HatchStyle)
        gr.DrawString(hatch_style.ToString, Me.Font, Brushes.Black, x, y)
        Dim the_brush As New Drawing2D.HatchBrush(hatch_style, Color.Black, Color.White)
        gr.FillRectangle(the_brush, x, y + 1510020)

        y += 40
        If y + 40 > Me.ClientRectangle.Height Then
            x += 150
            y = 20
        End If
    End Sub
  Public Sub New()
   
    MyBase.New()
    Me.AutoScaleBaseSize = New System.Drawing.Size(513)
    Me.ClientSize = New System.Drawing.Size(600600)
    Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen

  End Sub

End Class
17.63.HatchBrush
17.63.1.Use HatchBrush with HatchStyle.Horizontal to draw an arrowUse HatchBrush with HatchStyle.Horizontal to draw an arrow
17.63.2.List all Hatch stylesList all Hatch styles
17.63.3.Get All HatchStylesGet All HatchStyles
17.63.4.Use the HatchBrushUse the HatchBrush
17.63.5.Create HatchBrush from HatchBrush style and two colorsCreate HatchBrush from HatchBrush style and two colors
17.63.6.HatchStyle.LightUpwardDiagonalHatchStyle.LightUpwardDiagonal
17.63.7.HatchBrush HatchStyle BackwardDiagonalHatchBrush HatchStyle BackwardDiagonal
17.63.8.HatchStyle.DashedVerticalHatchStyle.DashedVertical
17.63.9.HatchStyle.SmallCheckerBoardHatchStyle.SmallCheckerBoard
17.63.10.HatchStyle.DarkDownwardDiagonalHatchStyle.DarkDownwardDiagonal
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.