using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;
namespace _1113640111秦超 { public partial class Form1 : Form { int r, g, b; public Form1() { InitializeComponent(); }
ColorDialog colorDialog1 = new ColorDialog();
colorDialog1.FullOpen = true; //是否显示ColorDialog有半部分
//colorDialog1.CustomColors = colorDialog1.Color;//设置自定义颜色
DialogResult result = colorDialog1.ShowDialog();
if (result == DialogResult.OK)//确定事件响应
{
Color color_from = colorDialog1.Color;
int a = color_from.R;
int b = color_from.G;
int c = color_from.B;
string str;
str=a.ToString()+" "+b.ToString()+" "+c.ToString()+" ";
MessageBox.Show(str);
}
------解决方案-------------------- 如果我想把颜色值转成Int类型的应该怎么办呢。
------解决方案--------------------