Convert known colors to their Argb int32 format - CSharp System

CSharp examples for System:Converter

Description

Convert known colors to their Argb int32 format

Demo Code


using System.Globalization;
using System.Drawing;
using System;//from w w w  . j  av a  2  s . com

public class Main{
        /// <summary>
        /// Convert known colors to their Argb int32 format
        /// </summary>
        /// <param name="color">Color to be converted</param>
        /// <returns></returns>
        public static int KnownToArgb(this KnownColor color)
        {
            return Color.FromKnownColor(color).ToArgb();
        }
}

Related Tutorials