예제 #1
0
        /// <summary>
        /// Converts the specified <see cref="RectI"/> to a GDI <see cref="Rectangle"/>.</summary>
        /// <param name="rect">
        /// The <see cref="RectI"/> instance to convert.</param>
        /// <returns>
        /// A new GDI <see cref="Rectangle"/> instance whose coordinates and dimensions equal those
        /// of the specified <paramref name="rect"/>.</returns>

        public static Rectangle ToGdiRect(this RectI rect)
        {
            return(new Rectangle(rect.X, rect.Y, rect.Width, rect.Height));
        }
예제 #2
0
        /// <summary>
        /// Converts the specified <see cref="RectI"/> to a WPF <see cref="Int32Rect"/>.</summary>
        /// <param name="rect">
        /// The <see cref="RectI"/> instance to convert.</param>
        /// <returns>
        /// A new WPF <see cref="Int32Rect"/> instance whose coordinates and dimensions equal those
        /// of the specified <paramref name="rect"/>.</returns>

        public static Int32Rect ToInt32Rect(this RectI rect)
        {
            return(new Int32Rect(rect.X, rect.Y, rect.Width, rect.Height));
        }