c# fill everything but GraphicsPath
问题 I have some code that looks like that: GraphicsPath p = new GraphicsPath(); // Add some elements to p ... // ... g.FillPath(bgBrush, p); // where g : Graphics and bgBrush : Brush Which results in something that looks like this: ### | ##| ## | How can I fill the exact complement of the path? Desired output: #| ## | # #| 回答1: I'm surprised no one answered so far - the solution is pretty simple. Just add a Rectangle to the path and everything inside gets reverted. protected override void OnPaint