Return to Snippet

Revision: 34588
at October 26, 2010 00:07 by dzr_gregory


Initial Code
/// <summary>
        /// Преобразует цвет WPF в цвет WindowsForms
        /// </summary>
        /// <param name="color">Цвет WPF</param>
        /// <returns>Цвет Windows Forms</returns>
        public static System.Drawing.Color ToColor(this System.Windows.Media.Color color)
        {
            return Color.FromArgb(color.A, color.R, color.G, color.B);
        }

        /// <summary>
        /// Преобразует цвет Windows Forms в цвет WPF
        /// </summary>
        /// <param name="color">Цвет WindowsForms</param>
        /// <returns>Цвет WPF</returns>
        public static System.Windows.Media.Color ToColor(this System.Drawing.Color color)
        {
            return System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B);
        }

Initial URL

                                

Initial Description

                                

Initial Title
WPF to/from WindowsForms colors conversion

Initial Tags
c, color

Initial Language
C#