G
Guest
Hi
I'm fairly new to C# graphics, but I think I've found a bug in PathGradientBrush
The following code *should* show a hollowed rectangle. In fact, there is an indentation on the left edge
Can someone experienced comment
Regard
Tony Reynold
code follows.........
// Set up a GraphicsPath of 2 nested rectangle
RectangleF rect1 = new RectangleF(0,0,300,200)
RectangleF rect2 = new RectangleF(50,50,200,100)
GraphicsPath path = new GraphicsPath();
path.AddRectangle(rect1);
path.AddRectangle(rect2)
path.CloseFigure();
// Set up a PathGradientBrush, use Aqua for start and finish colours to show bug clearl
PathGradientBrush pathGrBrush = new PathGradientBrush(p1)
Color[] colors = {Color.FromArgb(255, 0, 255, 255)}
pathGrBrush.SurroundColors = colors
pathGrBrush.CenterColor = Color.FromArgb(255, 0, 255, 255)
// Fill the outlin
e.Graphics.FillPath(pathGrBrush, path);
I'm fairly new to C# graphics, but I think I've found a bug in PathGradientBrush
The following code *should* show a hollowed rectangle. In fact, there is an indentation on the left edge
Can someone experienced comment
Regard
Tony Reynold
code follows.........
// Set up a GraphicsPath of 2 nested rectangle
RectangleF rect1 = new RectangleF(0,0,300,200)
RectangleF rect2 = new RectangleF(50,50,200,100)
GraphicsPath path = new GraphicsPath();
path.AddRectangle(rect1);
path.AddRectangle(rect2)
path.CloseFigure();
// Set up a PathGradientBrush, use Aqua for start and finish colours to show bug clearl
PathGradientBrush pathGrBrush = new PathGradientBrush(p1)
Color[] colors = {Color.FromArgb(255, 0, 255, 255)}
pathGrBrush.SurroundColors = colors
pathGrBrush.CenterColor = Color.FromArgb(255, 0, 255, 255)
// Fill the outlin
e.Graphics.FillPath(pathGrBrush, path);