System.Drawing.RectangleF.Inflate C# (CSharp) Method

Inflate() public static method

Creates a that is inflated by the specified amount.

public static Inflate ( RectangleF rect, float x, float y ) : RectangleF
rect RectangleF
x float
y float
return RectangleF
        public static RectangleF Inflate(RectangleF rect, float x, float y)
        {
            RectangleF r = rect;
            r.Inflate(x, y);
            return r;
        }

Same methods

RectangleF::Inflate ( System rect, float x, float y ) : System.Drawing.RectangleF
RectangleF::Inflate ( SizeF size ) : void
RectangleF::Inflate ( System size ) : void
RectangleF::Inflate ( float x, float y ) : void

Usage Example

 static public void DrawNode(ICanvas canvas, UnitPoint nodepoint)
 {
     RectangleF r = new RectangleF(canvas.ToScreen(nodepoint), new SizeF(0, 0));
     r.Inflate(3, 3);
     if (r.Right < 0 || r.Left > canvas.ClientRectangle.Width)
         return;
     if (r.Top < 0 || r.Bottom > canvas.ClientRectangle.Height)
         return;
     canvas.Graphics.FillRectangle(Brushes.White, r);
     r.Inflate(1, 1);
     canvas.Graphics.DrawRectangle(Pens.Black, ScreenUtils.ConvertRect(r));
 }
All Usage Examples Of System.Drawing.RectangleF::Inflate