//从Color类型得到RGB类型
public int GetRGBFromColor(Color color)
{
byte r = color.R;
byte g = color.G;
byte b = color.B;
//转化为32bit RGB值:
int rgb = (r & 0xff) | ((g & 0xff) << 8) | ((b & 0xff) << 16);
return rgb;
}