Encode Color As RGBA - CSharp System.Drawing

CSharp examples for System.Drawing:Color RGB

Description

Encode Color As RGBA

Demo Code


using System.Runtime.CompilerServices;
using System;/*from  ww w.jav  a 2  s.  c  om*/

public class Main{

        public static uint EncodeAsRGBA(byte red, byte green, byte blue, byte alpha)
        {
            return (uint)((red << 24) |
                (green << 16) |
                (blue << 8) |
                alpha);
        }
}

Related Tutorials