将RGB颜色转换为ARGB [英] Converting RGB colors to ARGB

查看:3124
本文介绍了将RGB颜色转换为ARGB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在大量使用RGB和ARGB颜色以及
需要制作一个应用来转换RGB颜色代码
到ARGB.

请提供任何帮助.

这是我尝试过的:

Hi all,

I''m working alot with RGB and ARGB colors and
need to make an app to convert RGB color codes
to ARGB.

Please any help would be appriciated.

This is what I tried:

        byte Alpha;
        byte Red;
        byte Green;
        byte Blue;

        int RGB;
....

        private long ARGB()
        {
            long functionReturnValue = 0;
            if (Alpha > 127)
            {
                functionReturnValue = ((Alpha - 128) * 0x1000000 | 0x80000000) | Red | (Green * 0x100L) | (Blue * 0x10000);
            }
            else
            {
                functionReturnValue = (Alpha * 0x1000000) | Red | (Green * 0x100L) | (Blue * 0x10000);
            }
            return functionReturnValue;
            RGB = Alpha & Red & Green & Blue;
        }

推荐答案

请阅读

这篇关于将RGB颜色转换为ARGB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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