Пример #1
0
 /// <summary>
 /// Converts the specified <see cref="SizeD"/> to a <see cref="Size"/> by rounding the values of the <see cref="SizeD"/> to the nearest integer.
 /// </summary>
 /// <param name="val">The <see cref="SizeD"/> to convert.</param>
 /// <returns>The <see cref="Size"/> this method converts to.</returns>
 public static Size Round(SizeD val) => new Size((int)Math.Round(val.Width), (int)Math.Round(val.Height));
Пример #2
0
 /// <summary>
 /// Converts the specified <see cref="SizeD"/> to a <see cref="Size"/> by truncating the values of the <see cref="SizeD"/>.
 /// </summary>
 /// <param name="val">The <see cref="SizeD"/> to convert.</param>
 /// <returns>The <see cref="Size"/> this converts to.</returns>
 public static Size Truncate(SizeD val) => new Size((int)Math.Truncate(val.Width), (int)Math.Truncate(val.Height));
Пример #3
0
 /// <summary>
 /// Converts the specified <see cref="SizeD"/> to a <see cref="Size"/> by rounding the values of the <see cref="SizeD"/> to the next higher integer values.
 /// </summary>
 /// <param name="val">The <see cref="SizeD"/> to convert.</param>
 /// <returns>The <see cref="Size"/> this method converts to.</returns>
 public static Size Ceiling(SizeD val) => new Size((int)Math.Ceiling(val.Width), (int)Math.Ceiling(val.Height));
Пример #4
0
 /// <summary>
 /// Returns the result of subtracting the specified <see cref="SizeD"/> from the specified <see cref="PointD"/>.
 /// </summary>
 /// <param name="pt">The <see cref="PointD"/> to be subtracted from.</param>
 /// <param name="sz">The <see cref="SizeD"/> to subtract from <paramref name="pt"/>.</param>
 public static PointD Subtract(PointD pt, SizeD sz) => new PointD(pt.X - sz.Width, pt.Y - sz.Height);
Пример #5
0
 /// <summary>
 /// Adds the specified <see cref="SizeD"/> to the specified <see cref="PointD"/>.
 /// </summary>
 /// <param name="pt">The <see cref="PointD"/> to add.</param>
 /// <param name="sz">The <see cref="SizeD"/> to add.</param>
 /// <returns>The <see cref="PointD"/> that is the result of the addition operation.</returns>
 public static PointD Add(PointD pt, SizeD sz) => new PointD(pt.X + sz.Width, pt.Y + sz.Height);
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PointD"/> structure from a <see cref="Size"/>.
 /// </summary>
 /// <param name="sz">A <see cref="Size"/> that specifies the coordinates for the new <see cref="PointD"/>.</param>
 public PointD(SizeD sz) : this(sz.Width, sz.Height)
 {
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RectangleD"/> class with the specified location and size.
 /// </summary>
 /// <param name="location">A <see cref="Point"/> that represents the upper-left corner of the rectangle.</param>
 /// <param name="size">A <see cref="Drawing.Size"/> that represents the width and height of the rectangle.</param>
 public RectangleD(PointD location, SizeD size) : this(location.X, location.Y, size.Width, size.Height)
 {
 }