如何着色在C面膜 [英] how to color mask in c

查看:114
本文介绍了如何着色在C面膜的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你怎么掩盖颜色为红,绿,蓝值的32位无符号整数

how do you color mask a 32 bit unsigned integer for the red, green, and blue values

是这样吗?
    (color_to_be_masked >> 8)

is it like this? (color_to_be_masked>>8)

推荐答案

这应该得到你想要的结果:

This should get you the result you want:

short red = (color >> 16) & 0xFF;
short green = (color >> 8) & 0xFF;
short blue = (color) & 0xFF;

这篇关于如何着色在C面膜的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆