public static Rectangle Union (Rectangle a, Rectangle b) { var left = Math.Min (a.Left, b.Left); var top = Math.Min (a.Top, b.Top); return new Rectangle (left, top, Math.Max (a.Right, b.Right) - left, Math.Max (a.Bottom, b.Bottom) - top); }
public bool IntersectsWith (Rectangle rect) { return !((Left >= rect.Right) || (Right <= rect.Left) || (Top >= rect.Bottom) || (Bottom <= rect.Top)); }
public static void DrawRect(this IGraphics g, Rectangle r, float w) { g.DrawRect(r.Left, r.Top, r.Width, r.Height, w); }
public static void FillRect(this IGraphics g, Rectangle r) { g.FillRect(r.Left, r.Top, r.Width, r.Height); }
public static void FillRoundedRect(this IGraphics g, Rectangle r, float radius) { g.FillRoundedRect (r.Left, r.Top, r.Width, r.Height, radius); }
public WmfGraphics (Stream s, Rectangle viewBox) : this (new BinaryWriter (s, System.Text.Encoding.UTF8), new RectangleF (viewBox.Left, viewBox.Top, viewBox.Width, viewBox.Height)) { }
public SvgGraphics (TextWriter tw, Rectangle viewBox) : this(tw, new RectangleF(viewBox.Left, viewBox.Top, viewBox.Width, viewBox.Height)) { }