Color To Byte Array - CSharp System

CSharp examples for System:Byte Array

Description

Color To Byte Array

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.IO;// w w  w .ja  va 2s  . c  om
using System.Drawing;
using System.Collections.Generic;
using System;

public class Main{
        public static byte[] ColorToByteArray(Color color)
        {
            byte[] colorArray = new byte[3];
            colorArray[0] = color.R;
            colorArray[1] = color.G;
            colorArray[2] = color.B;

            return colorArray;
        }
}

Related Tutorials