i am writing the venn diagram and i have a problem in intersection.
i draw circles but i can't fill the intersection of 3 or more circles.
i fill intersection of two circles with this code
Graphics g = this.CreateGraphics();
GraphicsPath path = new GraphicsPath();
Region region1 = new Region();
Brush blue = new SolidBrush(Color.Blue);
Brush white=new SolidBrush(Color.White);
Rectangle circle1 = new Rectangle(455, 200, 150, 150);
Rectangle circle2 = new Rectangle(455, 275, 150, 150);
g.FillEllipse(blue, circle1);
g.FillEllipse(blue, circle2);
path.AddEllipse(circle1);
path.AddEllipse(circle2);
region1.Intersect(path);
g.FillRegion(white, region1);
i mean something like this
Right now you're trying to intersect an infinite region with a single GraphicsPath object containing both of your circles. Since the region is infinite to begin with, the Intersect method will just return the region occupied by the GraphicsPath object you specific.
To fix this, create your region by passing a GraphicsPath representing the 1st circle to the constructor. Then call the Intersect function using a different GraphicsPath containing the 2nd circle.