请问c#中有没有vc里polypolygon功能的函数
大多边形包含小多边形时,在vc中用polypolygon可以直接填充中间的环形区域,请问c#中有类似功能的函数么?

解决方案 »

  1.   

    可以构造2个Region,外面的大Region把里面的小Region挖掉就是环形区域了
    protected override void OnPaint(PaintEventArgs e)
    {
        base.OnPaint(e);    GraphicsPath path1 = new GraphicsPath();
        path1.AddEllipse(0, 0, 100, 100);
        Region region1 = new Region(path1);    GraphicsPath path2 = new GraphicsPath();
        path2.AddEllipse(20, 20, 60, 60);
        Region region2 = new Region(path2);    region1.Exclude(region2);
        e.Graphics.FillRegion(Brushes.Red, region1);
    }