public Rectangle ToRectangle() { if (this.IsInfinite) { return(new Rectangle(-2147483647, -2147483647, 0x7fffffff, 0x7fffffff)); } IntNativeMethods.RECT clipRect = new IntNativeMethods.RECT(); IntUnsafeNativeMethods.GetRgnBox(new HandleRef(this, this.nativeHandle), ref clipRect); return(new Rectangle(new Point(clipRect.left, clipRect.top), clipRect.Size)); }
/// <summary> /// A rectangle representing the window region set with the SetWindowRgn function. /// </summary> public Rectangle ToRectangle() { if (IsInfinite) { return(new Rectangle(-int.MaxValue, -int.MaxValue, int.MaxValue, int.MaxValue)); } IntNativeMethods.RECT rect = new IntNativeMethods.RECT(); IntUnsafeNativeMethods.GetRgnBox(new HandleRef(this, nativeHandle), ref rect); return(new Rectangle(new Point(rect.left, rect.top), rect.Size)); }