/// <summary> /// Translates a given System.DrawingX.PointD by a specified System.DrawingX.SizeD. /// </summary> /// <param name="pt">The System.DrawingX.PointD to translate.</param> /// <param name="sz">The System.DrawingX.SizeD that specifies the numbers to add to the coordinates of pt.</param> /// <returns>The translated System.DrawingD.PointF.</returns> public static PointD Add(PointD pt, SizeD sz) { return(new PointD(pt.X + sz.Width, pt.Y + sz.Height)); }
/// <summary> /// Converts the specified System.DrawingX.SizeD structure to a System.Drawing.Size structure by /// truncating the values of the System.Drawing.SizeF structure to the next lower integer values. /// </summary> /// <param name="value">The System.DrawingX.SizeD structure to convert.</param> /// <returns>The System.Drawing.Size structure this method converts to.</returns> public static Size Truncate(SizeD value) { return(new Size((int)Math.Truncate(value.Width), (int)Math.Truncate(value.Height))); }
/// <summary> /// Subtracts the width and height of one System.DrawingX.SizeD structure from the width and height /// of another System.DrawingX.SizeD structure. /// </summary> /// <param name="sz1">The System.DrawingX.SizeD structure on the left side of the subtraction operator.</param> /// <param name="sz2">The System.DrawingX.SizeD structure on the right side of the subtraction operator.</param> /// <returns>A System.DrawingX.SizeD structure that is a result of the subtraction operation.</returns> public static SizeD Subtract(SizeD sz1, SizeD sz2) { return(new SizeD(sz1.Width - sz2.Width, sz1.Height - sz2.Height)); }
/// <summary> /// Converts the specified System.DrawingX.SizeD structure to a System.Drawing.Size /// structure by rounding the values of the System.DrawingX.SizeD structure to /// the nearest integer values. /// </summary> /// <param name="value">The System.DrawingX.SizeD structure to convert.</param> /// <returns> The System.Drawing.Size structure this method converts to.</returns> public static Size Round(SizeD value) { return(new Size((int)Math.Round(value.Width), (int)Math.Round(value.Height))); }
/// <summary> /// Converts the specified System.DrawingX.SizeD structure to a System.Drawing.Size /// structure by rounding the values of the System.DrawingX.SizeD structure to /// the next higher integer values. /// </summary> /// <param name="value">The System.DrawingX.SizeD structure to convert.</param> /// <returns>The System.Drawing.Size structure this method converts to.</returns> public static Size Ceiling(SizeD value) { return(new Size((int)Math.Ceiling(value.Width), (int)Math.Ceiling(value.Height))); }
/// <summary> /// Adds the width and height of one System.DrawingX.SizeD structure to the width and height of another System.DrawingX.SizeD structure. /// </summary> /// <param name="sz1">The first System.DrawingX.SizeD structure to add.</param> /// <param name="sz2">The second System.DrawingX.SizeD structure to add.</param> /// <returns>A System.DrawingX.SizeD structure that is the result of the addition operation.</returns> public static SizeD Add(SizeD sz1, SizeD sz2) { return(new SizeD(sz1.Width + sz2.Width, sz1.Height + sz2.Height)); }