颜色值转换,比如"#EE22FF"如果转换为Color.FromArgb(0,0,0,0);这四个整数。
2011-12-06 10:01
309 查看
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Drawing; namespace HCLoad.Web { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Response.Write(getARGB("#0a246a")); } private string getARGB(string strColor) { Color col = ColorTranslator.FromHtml(strColor); int alpha = col.A; int red = col.R; int green = col.G; int blue = col.B; //Color bColor = Color.FromArgb(alpha, red, green, blue); return alpha + "," + red + "," + green + "," + blue; } } }
相关文章推荐
- 在Silverlight中颜色值转换,比如"#EE22FF"如果转换为Color.FromArgb(0,0,0,0);这四个整数。
- 在Silverlight中颜色值转换,比如"#EE22FF"如果转换为Color.FromArgb(0,0,0,0);这四个整数。
- 将十六进制数QString转换为int型整数(比如将QString型的"F1"转换为int型是241)
- Color.FromArgb设置颜色
- 输入整数角谷步数 你听说过角谷猜想吗? 任意的正整数,比如 5, 我们从它开始,如下规则计算: 如果是偶数,则除以2,如果是奇数,则乘以3再加1. 如此循环,最终必会得到“1” !输入整数
- 【OpenCV3】颜色空间转换——cv::cvtColor()详解
- [Silverlight]16进制颜色转ARGB及Color转Int32
- 利用cvtColor实现图像颜色空间的转换-比如RGB转灰度图等
- 输入一个整数,如果该整数介于1到12之间,则输出对应的月份,比如输入为1,则输出”April“;否则输出”not valid month number
- WPF中将四个数字字符串值(比如:"10,10,300,300")转为Rect
- C#十六进制颜色与Color对象的互相转换
- 5.输入一个整数,如果该整数介于1到12之间,则输出对应的月份,比如输入为4,则输出”April“ -_-!;否则输出”not valid month number“
- 身份证校验 如果让你设计个程序,用什么变量保存身份证号码呢?长整数可以吗?不可以! 因为有人的身份证最后一位是"X"
- ASP.NET HTML颜色转换成Color值
- 如果要将整数A转换为B,需要改变多少个bit位?
- 动态输入String改变TextView的颜色(String转换成Color)
- QtCreator 提示错误:Undefined symbols for architecture x86_64: "vtable for XXX", referenced from
- 把数字日期里的"月份"单独拿出来转换成对应的汉字月份
- 将整数转换为相应的一个字符数组。 分析:从个位提取数字,组合字符 符号位的处理 12345=>"12345"
- Android 自定义的颜色滑动转换ViewPager指示器 ColorTransformIndicator