/// <summary> /// Converts a rectangle from an Avalon Rect to a Win32 RECT /// </summary> /// <remarks> /// Rounds "double" values to the nearest "int" /// </remarks> /// <param name="rect"> /// The rectangle as an Avalon Rect /// </param> /// <returns> /// The rectangle as a Win32 RECT /// </returns> internal static NativeMethods.RECT FromRect(Rect rect) { NativeMethods.RECT rc = new NativeMethods.RECT(); rc.top = DoubleUtil.DoubleToInt(rect.Y); rc.left = DoubleUtil.DoubleToInt(rect.X); rc.bottom = DoubleUtil.DoubleToInt(rect.Bottom); rc.right = DoubleUtil.DoubleToInt(rect.Right); return(rc); }
/// <summary> /// Converts a location from an Avalon Point to a Win32 POINT /// </summary> /// <remarks> /// Rounds "double" values to the nearest "int" /// </remarks> /// <param name="point"> /// The location as an Avalon Point /// </param> /// <returns> /// The location as a Win32 POINT /// </returns> internal static NativeMethods.POINT FromPoint(Point point) { return(new NativeMethods.POINT(DoubleUtil.DoubleToInt(point.X), DoubleUtil.DoubleToInt(point.Y))); }