Color - ToWin32
Translates the specified structure to a Windows color.
public static void Main() { Color myColor = Color.Red; //C# Extension Method: Color - ToWin32 int winColor = myColor.ToWin32(); Console.WriteLine(winColor); }
View Source
using System; #if !NETSTANDARD using System.Drawing; #endif public static partial class Extensions { #if !NETSTANDARD /// <summary> /// Translates the specified structure to a Windows color. /// </summary> /// <param name="c">The structure to translate.</param> /// <returns>The Windows color value.</returns> public static Int32 ToWin32(this Color c) { return ColorTranslator.ToWin32(c); } #endif }