【发布时间】:2019-09-19 21:54:07
【问题描述】:
我需要将一个字节转换为 4 位,以便它可以用作颜色。
byte input;
byte r = //the first and second bits of input ;
byte g = //the third and forth bits of input ;
byte b = //the fifth and sixth bits of input ;
Color32 output = new Color32(r,g,b);
我尝试使用按位运算符,但我不太擅长。
【问题讨论】:
标签: c#