Пример #1
0
        // Return true if this column is all white.
        private static bool ColumnIsWhite(Bitmap32 bm32, int x)
        {
            byte r, g, b, a;
            int  count = 0;

            for (int y = 0; y < bm32.Height; y++)
            {
                bm32.GetPixel(x, y, out r, out g, out b, out a);
                if (((r < 250) || (g < 250) || (b < 250)) && ((r > 2) || (g > 2) || (b > 2)))
                {
                    count++;
                }
                if (count > bm32.Height / 10)
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #2
0
        // Return true if this row is all white.
        private static bool RowIsWhite(Bitmap32 bm32, int y)
        {
            byte r, g, b, a;
            int  count = 0;

            for (int x = 0; x < bm32.Width; x++)
            {
                bm32.GetPixel(x, y, out r, out g, out b, out a);

                if (((r < 250) || (g < 250) || (b < 250)) && ((r > 2) || (g > 2) || (b > 2)))
                {
                    count++;
                }
                if (count > bm32.Width / 10)
                {
                    return(false);
                }
            }
            return(true);
        }