using Windows.Foundation; using Windows.UI; namespace Vanara.PInvoke { /// Conversion extension methods for WinUI/UWP and Vanara types. public static class SystemFoundationExtensions { /// Converts to . /// The point to convert. /// The converted value. public static Point ToPoint(this in POINT pt) => new(pt.X, pt.Y); /// Converts to . /// The size to convert. /// The converted value. public static Size ToSize(this in SIZE sz) => new(sz.cx, sz.cy); /// Converts to . /// The color to convert. /// The converted value. public static Color ToColor(this in COLORREF c) => new() { A = c.A, R = c.R, G = c.G, B = c.B }; /// Converts to . /// The color to convert. /// The converted value. public static COLORREF ToCOLORREF(this in Color c) => new(c.R, c.G, c.B) { A = c.A }; } }