我取得了一个BYTE 怎么转换成具体的颜色比如
byte result=115;如何转换成具体的颜色

解决方案 »

  1.   

    转成成十六进制,然后根据这个值
    Color c = Color.FromArgb(0x64C8C8FF);
      

  2.   

    http://hi.baidu.com/%CE%D2%C3%C7%B8%C4%B1%E4%C9%FA%BB%EE/blog/item/f3c37100b10dd515728b65ab.html
      

  3.   


    static void Main(string[] args)
            {
                byte[] bytes = new byte[10000];
                int k = 0;            for (int i = 0; i < 100; i++)
                {
                    for (int j = 0; j < 100; j++)
                    {
                        bytes[k++] = (byte)(i + j);
                    }
                }            Bitmap bmp = ToGrayBitmap(bytes, 100, 100);            bmp.Save(@"d:test.png", System.Drawing.Imaging.ImageFormat.Png);
            }