RT,
根据一个区域,Region,计算能表示该区域的GraphicsPath。可否?或者有否第三方的方法?
算法如何?

解决方案 »

  1.   

    Region的构造函数第四个不就是GraphicsPath做参数么
    Region region = new Region(new  System.Drawing.Drawing2D.GraphicsPath());
      

  2.   

    但是我想要的是从Region计算出GraphicsPath……
      

  3.   


    System.Drawing.Drawing2D.GraphicsPath p = new System.Drawing.Drawing2D.GraphicsPath();
    RectangleF[] rf =  button1.Region.GetRegionScans(new System.Drawing.Drawing2D.Matrix());
                            p.AddRectangles(rf);看了看msdn,你试试这样可以么
      

  4.   

    我试试……
    但是看到算法,如果Region中存在曲线应该就扫描不出来了?
      

  5.   

    获取Region每个边缘点,然后将获取到的边缘点生成一个GraphicPath,将此Graphicpath放大相应倍数.