예제 #1
0
        /// <summary>
        ///  Selects a region as the current clipping region for the device context.
        ///  Remarks (From MSDN):
        ///  - Only a copy of the selected region is used. The region itself can be selected for any number of other device contexts or it can be deleted.
        ///  - The SelectClipRgn function assumes that the coordinates for a region are specified in device units.
        ///  - To remove a device-context's clipping region, specify a NULL region handle.
        /// </summary>
        public void SetClip(WindowsRegion region)
        {
            HandleRef hdc     = new HandleRef(this, Hdc);
            HandleRef hRegion = new HandleRef(region, region.HRegion);

            IntUnsafeNativeMethods.SelectClipRgn(hdc, hRegion);
        }