您的位置:首页 > 其它

颜色值转换,比如"#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;
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐