예제 #1
0
        public void Complement(RectangleF rect)
        {
            GPRECTF gprectf = rect.ToGPRECTF();
            int     status  = SafeNativeMethods.Gdip.GdipCombineRegionRect(new HandleRef(this, _nativeRegion), ref gprectf, CombineMode.Complement);

            SafeNativeMethods.Gdip.CheckStatus(status);
        }
예제 #2
0
파일: Region.cs 프로젝트: ash2005/z
        // 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.Gdip.GdipCombineRegionRect(new HandleRef(this, nativeRegion), ref gprectf, CombineMode.Complement);

            if (status != SafeNativeMethods.Gdip.Ok)
            {
                throw SafeNativeMethods.Gdip.StatusException(status);
            }
        }
 public Region(RectangleF rect)
 {
     IntPtr zero = IntPtr.Zero;
     int status = SafeNativeMethods.Gdip.GdipCreateRegionRect(ref rect.ToGPRECTF(), out zero);
     if (status != 0)
     {
         throw SafeNativeMethods.Gdip.StatusException(status);
     }
     this.SetNativeRegion(zero);
 }
예제 #4
0
        public Region(RectangleF rect)
        {
            IntPtr  region  = IntPtr.Zero;
            GPRECTF gprectf = rect.ToGPRECTF();
            int     status  = SafeNativeMethods.Gdip.GdipCreateRegionRect(ref gprectf, out region);

            SafeNativeMethods.Gdip.CheckStatus(status);

            SetNativeRegion(region);
        }
예제 #5
0
        public Region(RectangleF rect)
        {
            IntPtr zero   = IntPtr.Zero;
            int    status = SafeNativeMethods.Gdip.GdipCreateRegionRect(ref rect.ToGPRECTF(), out zero);

            if (status != 0)
            {
                throw SafeNativeMethods.Gdip.StatusException(status);
            }
            this.SetNativeRegion(zero);
        }
예제 #6
0
파일: Region.cs 프로젝트: mind0n/hive
        public Region(RectangleF rect) {
            IntPtr region = IntPtr.Zero;

            GPRECTF gprectf = rect.ToGPRECTF();

            int status = SafeNativeMethods.Gdip.GdipCreateRegionRect(ref gprectf, out region);

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

            SetNativeRegion(region);
        }
예제 #7
0
파일: Region.cs 프로젝트: ash2005/z
        public Region(RectangleF rect)
        {
            IntPtr region = IntPtr.Zero;

            GPRECTF gprectf = rect.ToGPRECTF();

            int status = SafeNativeMethods.Gdip.GdipCreateRegionRect(ref gprectf, out region);

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

            SetNativeRegion(region);
        }
 public GraphicsContainer BeginContainer(RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit)
 {
     GraphicsContext context = new GraphicsContext(this);
     int state = 0;
     GPRECTF dstRect = dstrect.ToGPRECTF();
     GPRECTF srcRect = srcrect.ToGPRECTF();
     int status = SafeNativeMethods.Gdip.GdipBeginContainer(new HandleRef(this, this.NativeGraphics), ref dstRect, ref srcRect, (int) unit, out state);
     if (status != 0)
     {
         context.Dispose();
         throw SafeNativeMethods.Gdip.StatusException(status);
     }
     context.State = state;
     this.PushContext(context);
     return new GraphicsContainer(state);
 }
 public void Intersect(RectangleF rect)
 {
     GPRECTF gprectf = rect.ToGPRECTF();
     int status = SafeNativeMethods.Gdip.GdipCombineRegionRect(new HandleRef(this, this.nativeRegion), ref gprectf, CombineMode.Intersect);
     if (status != 0)
     {
         throw SafeNativeMethods.Gdip.StatusException(status);
     }
 }
예제 #10
0
파일: Region.cs 프로젝트: mind0n/hive
        // 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.Gdip.GdipCombineRegionRect(new HandleRef(this, nativeRegion), ref gprectf, CombineMode.Complement);

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