Create HatchBrush: style and color : HatchBrush « 2D « C# / CSharp Tutorial






Create HatchBrush: style and color
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

public class BrushHatcHorizontalBrick : System.Windows.Forms.Form
{
  public BrushHatcHorizontalBrick()
  {
    this.BackColor = System.Drawing.Color.White;
    this.ClientSize = new System.Drawing.Size(400, 400);
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.BrushHatcHorizontalBrick_Paint);
  }

  static void Main() 
  {
    Application.Run(new BrushHatcHorizontalBrick());
  }

  private void BrushHatcHorizontalBrick_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
  {
    Graphics g = e.Graphics;

    Brush brHatch = new HatchBrush(HatchStyle.HorizontalBrick,Color.Red, Color.Yellow);
    g.FillEllipse(brHatch, 200, 200, 150, 190);
  }
}








27.29.HatchBrush
27.29.1.new HatchBrush(HatchStyle.Cross,Color.White,Color.Black)
27.29.2.new HatchBrush
27.29.3.HatchBrush StyleHatchBrush Style
27.29.4.Create HatchBrush: style and colorCreate HatchBrush: style and color
27.29.5.HatchStyle.Plaid
27.29.6.HatchStyle.ZigZag
27.29.7.HatchStyle.LargeConfetti
27.29.8.Hatch Brush Array (HatchStyle minimum and maximum values)