Pen p1 = new Pen(Color.BurlyWood);
g.DrawRectangle(p1, 60, 300 - 640/20, 35, 640/20);如何给我画出来的这个矩形填充颜色?

解决方案 »

  1.   

    FillRegion
                PointF[] pf = new PointF[100];
                byte[] bs = new byte[100];
                for (int i = 0; i < 100; i++)
                {
                    pf[i] = new PointF(yourXcoord, yourYcoord);
                    bs[i]=(byte)PathPointType.Line;
                }
                GraphicsPath gp = new GraphicsPath(pf,bs);
                System.Drawing.Region re = new Region(gp);
                g.FillRegion(Brushes.Green, re);            gp.Dispose();
                re.Dispose();
      

  2.   

    不明白。。怎么定义这个Brush?
      

  3.   

    brush有许多子类,看msdn
    可以用颜色,图片等来制作brush
      

  4.   


    SolidBrush blueBrush = new SolidBrush(Color.Blue);查MSDN