如题,填充Rectangle的外部,代码是什么?在线等,解决马上结贴

解决方案 »

  1.   

    您回答了我的关于
    http://topic.csdn.net/u/20101019/09/871e60a0-34c8-446f-be07-a95b959174fd.html
    知道我想填充外部,也就是画完把矩形框外面的再涂一下
      

  2.   

    picturebox的内部有个矩形,怎么把这个矩形框的外部填充一下底色也行最笨的方法是分成四部分来填充,不知道还有没有别的好方法等待高手......
      

  3.   

    用XOR来得到外部的Region
    public partial class Form1 : Form
        {
            Region m_Region;
            public Form1()
            {
                InitializeComponent();
                // The rectangle in the picture box
                Region rec1 = new Region(new Rectangle(10, 10, 30, 30));
                
                // The picture box region
                Region rec2 = new Region(pictureBox1.ClientRectangle);            // Get the region out of the retangle
                rec2.Xor(rec1);            m_Region = rec2;
            }        private void pictureBox1_Paint(object sender, PaintEventArgs e)
            {
                e.Graphics.FillRegion(Brushes.Red, m_Region);
            }
        }