System.Windows.Forms.Form.GetScaledBounds C# (CSharp) Method

GetScaledBounds() private method

private GetScaledBounds ( Rectangle bounds, SizeF factor, BoundsSpecified specified ) : Rectangle
bounds System.Drawing.Rectangle
factor System.Drawing.SizeF
specified BoundsSpecified
return System.Drawing.Rectangle
		protected override Rectangle GetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified)
		{
			if ((specified & BoundsSpecified.Width) == BoundsSpecified.Width) {
				int border = Size.Width - ClientSize.Width;
				bounds.Width = (int)Math.Round ((bounds.Width - border) * factor.Width) + border;
			}
			if ((specified & BoundsSpecified.Height) == BoundsSpecified.Height) {
				int border = Size.Height - ClientSize.Height;
				bounds.Height = (int)Math.Round ((bounds.Height - border) * factor.Height) + border;
			}

			return bounds;
		}
Form