Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If HatchStyle is Horizontal, can I give Hatch interval or rotation angle?
I tried searching, but I did not find any related issues.

Below is the code I used.

Source Code:

GraphicsPath gPath = new GraphicsPath();
gPath.AddEllipse(DrawX, DrawY, DrawWidth, DrawHeight);

GraphicsPath gPath = new GraphicsPath();
gPath.AddEllipse(DrawX, DrawY, DrawWidth, DrawHeight);

Matrix matrix = new Matrix();
matrix.RotateAt(Rotation, new PointF((DrawX + DrawWidth / 2), (DrawY + DrawHeight / 2)));
gPath.Transform(matrix);

g.DrawPath(Pens.Black, gPath);

if (UseHatch)
{
HatchBrush theBrush = new HatchBrush(HatchStyle.Horizontal, Color.Black, Color.White);
g.FillPath(theBrush, gPath);
}

gPath.Dispose();

What I have tried:

Search
Review the HatchBrush property
Rectangle Crash Point Coordinate Extraction Review
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900