Exemple #1
0
        // float version
        /// <include file='doc\Region.uex' path='docs/doc[@for="Region.Complement"]/*' />
        /// <devdoc>
        ///    Updates this <see cref='System.Drawing.Region'/> to the portion of the
        ///    specified <see cref='System.Drawing.RectangleF'/> that does not intersect with this <see cref='System.Drawing.Region'/>.
        /// </devdoc>
        public void Complement(RectangleF rect)
        {
            GPRECTF gprectf = rect.ToGPRECTF();
            int     status  = SafeNativeMethods.GdipCombineRegionRect(new HandleRef(this, nativeRegion), ref gprectf, CombineMode.Complement);

            if (status != SafeNativeMethods.Ok)
            {
                throw SafeNativeMethods.StatusException(status);
            }
        }
Exemple #2
0
        // float version
        /// <include file='doc\Region.uex' path='docs/doc[@for="Region.Exclude"]/*' />
        /// <devdoc>
        ///    Updates this <see cref='System.Drawing.Region'/> to the portion of its interior
        ///    that does not intersect with the specified <see cref='System.Drawing.RectangleF'/>.
        /// </devdoc>
        public void Exclude(RectangleF rect)
        {
            GPRECTF gprectf = new GPRECTF(rect);
            int     status  = SafeNativeMethods.GdipCombineRegionRect(new HandleRef(this, nativeRegion), ref gprectf, CombineMode.Exclude);

            if (status != SafeNativeMethods.Ok)
            {
                throw SafeNativeMethods.StatusException(status);
            }
        }