得到颜色的整形值

//从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;
        }

posted @ 2015-08-31 18:21  卡萨丁·周  阅读(285)  评论(0)    收藏  举报