简体   繁体   中英

How do you convert an int byte colour value (0-255) into a float / double value (0-1) in C#?

它说如何在各处将浮点颜色值转换为字节颜色值,我想知道相反的方法,有人可以帮助我吗?

您必须将字节值除以255。

double d = (double)byteValue / 255

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM