示例#1
0
 /// <summary>
 /// Converts the specified <see cref="SizeF"/> structure to a <see cref="Size"/> structure by rounding the values of the <see cref="SizeF"/> structure to the nearest integer values.
 /// </summary>
 /// <returns>
 /// The <see cref="Size"/> structure this method converts to.
 /// </returns>
 /// <param name="value">
 /// The <see cref="SizeF"/> structure to convert. 
 /// </param>
 public static Size Round(SizeF value)
 {
     return new Size((int)Math.Round(value.Width), (int)Math.Round(value.Height));
 }
示例#2
0
 /// <summary>
 /// Converts the specified <see cref="SizeF"/> structure to a <see cref="Size"/> structure by truncating the values of the <see cref="SizeF"/> structure to the next lower integer values.
 /// </summary>
 /// <returns>
 /// The <see cref="Size"/> structure this method converts to.
 /// </returns>
 /// <param name="value">
 /// The <see cref="SizeF"/> structure to convert. 
 /// </param>
 public static Size Truncate(SizeF value)
 {
     return new Size((int)value.Width, (int)value.Height);
 }
示例#3
0
 /// <summary>
 /// Converts the specified <see cref="SizeF"/> structure to a <see cref="Size"/> structure by rounding the values of the <see cref="Size"/> structure to the next higher integer values.
 /// </summary>
 /// <returns>
 /// The <see cref="Size"/> structure this method converts to.
 /// </returns>
 /// <param name="value">
 /// The <see cref="SizeF"/> structure to convert. 
 /// </param>
 public static Size Ceiling(SizeF value)
 {
     return new Size((int)Math.Ceiling(value.Width), (int)Math.Ceiling(value.Height));
 }