/// <summary> /// <para>Get the smallest rectangle that completely contains /// this region.</para> /// </summary> /// /// <returns> /// <para>A <see cref="T:Xsharp.Rectangle"/> instance corresponding /// to the smallest rectangle that contains the region.</para> /// </returns> public Rectangle ClipBox() { lock (typeof(Region)) { Rectangle rect; if (region == IntPtr.Zero) { rect = new Rectangle(0, 0, 0, 0); } else { XRectangle xrect; Xlib.XClipBox(region, out xrect); rect = new Rectangle(xrect.x, xrect.y, xrect.width, xrect.height); } return(rect); } }