How do I use hatched and gradient brush types

Platform: WinForms| Category: Brushes

The Brushes Sample shows you how to use four different brushes in several shapes. Below is a code snippet showing how to use hatched and gradient brushes.


Rectangle rect = new Rectangle(35, 190, 100, 100);       
 LinearGradientBrush brush2 = new LinearGradientBrush(rect, 
                           Color.DarkOrange, Color.Aquamarine, 
                          LinearGradientMode.ForwardDiagonal); 
 g.FillEllipse(brush2, 35, 190, 100, 100); 
 
 HatchBrush brush1 = new HatchBrush(HatchStyle.DiagonalCross, 
                          Color.DarkOrange, Color.Aquamarine); 
 g.FillEllipse(brush1, 35, 190, 100, 100);

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.