I've learned a few tricks in using graphics and graphicsPath, a collection of graphicsPath objects did it. now my problem is the hit testing of overlapping objects. i have to connect some points, but my lines can't cross the objects in collection. i tried creating a region, but isVisible doesn't work and i really don't know way.
foreach (PointF pi in points)
{
foreach (PointF pj in points)
{
gpRegionForLine = new GraphicsPath();
gpRegionForLine.AddLine(pi.X - 1, pi.Y - 1, pj.X - 1, pj. Y - 1);
gpRegionForLine.AddLine(pj.X - 1, pj.Y - 1, pi.X - 1, pi.Y - 2);
regionForLine = new Region(gpRegionForLine);
foreach (GraphicsPath gpi in allGraphicsPath)
{
if (!(regionForLine.IsVisible(gpi.GetBounds())))
g.FillRegion(Brushes.BlueViolet, regionForLine);
}
the if condition is always true, and shouldn't
any ideas? or maybe another idea?