Пример #1
0
        public override int[] ToColorKeyLimit(int[] buffer, int start, int end)
        {
            int sred   = LColor.GetRed(start);
            int sgreen = LColor.GetGreen(start);
            int sblue  = LColor.GetBlue(start);
            int ered   = LColor.GetRed(end);
            int egreen = LColor.GetGreen(end);
            int eblue  = LColor.GetBlue(end);
            int size   = buffer.Length;

            for (int i = 0; i < size; i++)
            {
                int pixel = buffer[i];
                int r     = LColor.GetRed(pixel);
                int g     = LColor.GetGreen(pixel);
                int b     = LColor.GetBlue(pixel);
                if ((r >= sred && g >= sgreen && b >= sblue) &&
                    (r <= ered && g <= egreen && b <= eblue))
                {
                    buffer[i] = 0x00FFFFFF;
                }
            }

            return(buffer);
        }