示例#1
0
        private static int GetPointSum(ExtendedImage image, int x, int y)
        {
            int total = image.GetRed(new Point(x, y)) +
                        image.GetBlue(new Point(x, y)) +
                        image.GetGreen(new Point(x, y));

            return(total);
        }
示例#2
0
        public static int GetSum(ExtendedImage image, int stepX, int stepY, int x, int y, int min2, int max2, int sum)
        {
            for (int avgy = 0; avgy < stepY; avgy++)
            {
                for (int avgx = 0; avgx < stepX; avgx++)
                {
                    sum = sum + (image.GetRed(new Point(x, y)) + image.GetBlue(new Point(x, y)) + image.GetGreen(new Point(x, y)));
                }
            }

            return(sum);
        }