Graphics.IntersectClip Method (Region)
Assembly: System.Drawing (in System.Drawing.dll)
Creates a rectangle with upper-left corner at (0, 0).
Creates a region and sets it to the rectangle, and sets the clipping region to this region.
Creates a second rectangle with upper-left corner at (100, 100).
Creates a region and sets it to the second rectangle, and sets the clipping region to the intersection of this region and the current clipping region (the first rectangle) using a combine mode of Replace.
Fills a large rectangle that includes both previous regions with a solid blue brush.
Resets the clipping region to infinite.
Draws rectangles around the two clipping regions. It uses a black pen for the first clipping region and a red pen for the second clipping region.
The result is that only the intersection of the two regions is filled with blue.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.