Nevron .NET Vision
Framework / Presentation Layer / Graphics / Appearance Styles / Fill Styles / Hatch Fill Style

In This Topic
    Hatch Fill Style
    In This Topic

    The hatch fill style is used to fill an object with a hatch pattern. It is represented by an instance of the NHatchFillStyle class. The following examples applies a hatch fill style to an object:

    C#
    Copy Code
    someObject.FillStyle = new NHatchFillStyle(HatchStyle.Cross, Color.White, Color.Black);
    
    Visual Basic
    Copy Code
    someObject.FillStyle = new NHatchFillStyle(HatchStyle.Cross, Color.White, Color.Black)
    
     Hatch Colors
    There are two colors associated with each hatch - foreground color and background end color. They can be controlled by the ForegroundColor and BackgroundColor properties respectively.  
     Hatch Pattern Style

    There are 48 predefined gradient styles, which are enumerated by the System.Drawing.Drawing2D.HatchStyle enumeration. The gradient style is controlled by the Style property.

    The following table shows the different hatch pattern styles with a White foreground and Black background color.

    Pattern Name Preview Pattern Name Preview Pattern Name Preview
    Percent 5 Wide Downward Diagonal Diagonal Brick
    Percent 10 Wide Upward Diagonal Horizontal Brick
    Percent 20 Light Vertical Weave
    Percent 25 Light Horizontal Plaid
    Percent 30 Narrow Vertical Divot
    Percent 40 Narrow Horizontal Dotted Grid
    Percent 50 Dark Vertical Dotted Diamond
    Percent 60 Dark Horizontal Shingle
    Percent 70 Dashed Downward Diagonal Trellis
    Percent 75 Dashed Upward Diagonal Sphere
    Percent 80 Dashed Horizontal Small Grid
    Percent 90 Dashed Vertical Large Grid
    Light Downward Diagonal Small Confetti Small Checker Board
    Light Upward Diagonal Large Confetti Large Checker Board
    Dark Downward Diagonal Zig Zag Outlined Diamond
    Dark Upward Diagonal Wave Solid Diamond

    You can use the table above as a visual reference for the hatch pattern style. To get the pattern constant all you have to do is to concatenate the words in the pattern name columns. For example if you want to achieve a "Zig Zag" pattern you must use the following code:

    C#
    Copy Code
    someObject.FillStyle = new NHatchFillStyle(HatchStyle.ZigZag, Color.White, Color.Black);
    
    Visual Basic
    Copy Code
    someObject.FillStyle = new NHatchFillStyle(HatchStyle.ZigZag, Color.White, Color.Black)
    
    See Also