Exemple #1
0
        public byte[] ToByteStream()
        {
            byte[] b = new byte[streamLength];

            foreach (var k in defaultColorOffsets)
            {
                byte[] c = PaletteHelper.ColorToByte(k.c);
                b[k.position]     = c[0];
                b[k.position + 1] = c[1];
            }

            foreach (var k in labelsToMemOffsets.Keys)
            {
                Color  col = this.GetColor(k);
                byte[] c   = PaletteHelper.ColorToByte(col);
                foreach (int offset in labelsToMemOffsets[k])
                {
                    b[offset]     = c[0];
                    b[offset + 1] = c[1];
                }
            }

            return(b);
        }