Exemple #1
0
		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);
		}
Exemple #2
0
		public bool IntersectsWith (Rectangle rect)
		{
			return !((Left >= rect.Right) || (Right <= rect.Left) ||
			         (Top >= rect.Bottom) || (Bottom <= rect.Top));
		}
Exemple #3
0
		public static void DrawRect(this IGraphics g, Rectangle r, float w)
		{
			g.DrawRect(r.Left, r.Top, r.Width, r.Height, w);
		}
Exemple #4
0
		public static void FillRect(this IGraphics g, Rectangle r)
		{
			g.FillRect(r.Left, r.Top, r.Width, r.Height);
		}
Exemple #5
0
		public static void FillRoundedRect(this IGraphics g, Rectangle r, float radius)
		{
			g.FillRoundedRect (r.Left, r.Top, r.Width, r.Height, radius);
		}
Exemple #6
0
		public WmfGraphics (Stream s, Rectangle viewBox)
            : this (new BinaryWriter (s, System.Text.Encoding.UTF8), new RectangleF (viewBox.Left, viewBox.Top, viewBox.Width, viewBox.Height))
		{
		}
Exemple #7
0
		public SvgGraphics (TextWriter tw, Rectangle viewBox) 
			: this(tw, new RectangleF(viewBox.Left, viewBox.Top, viewBox.Width, viewBox.Height))
		{
		}