예제 #1
0
        public static int GetBottomBarHeight(this Image <Rgba32> image)
        {
            int counter = 0;
            var color   = image[0, image.Height - 1];

            for (int i = image.Height - 2; i >= 0; i--)
            {
                //if (image[0, i] == color)
                if (RaidImageConfiguration.IsColorWithinTolerance(image[0, i], color, 5))
                {
                    counter++;
                }
                else
                {
                    return(counter);
                }
            }
            return(counter);
        }
예제 #2
0
        private bool HasTopMenu(Image <Rgba32> image)
        {
            // If the whole line has the exact same color it probably is a menu
            var color = image[0, 0];

            for (int x = 1; x < image.Width; x++)
            {
                if (image[x, 0] != color)
                {
                    return(false);
                }
            }

            // Check if it might be an (IPhone) open hot spot info instead
            if (RaidImageConfiguration.IsColorWithinTolerance(color, new Rgba32(36, 132, 232, 255), 5))
            {
                return(false);
            }

            return(true);
        }