Max() public static method

Computes the maximum pixel value in the given image.
public static Max ( this image ) : int
image this
return int
コード例 #1
0
        public void MaxTest2()
        {
            Bitmap image = new byte[, ]
            {
                { 5, 2, 7 },
                { 5, 3, 5 },
                { 9, 1, 2 }
            }.ToBitmap();

            {
                Rectangle rectangle = new Rectangle(1, 0, 2, 2);
                int       expected  = 7;
                int       actual    = Tools.Max(image, rectangle);
                Assert.AreEqual(expected, actual);
            }
            {
                int expected = 9;
                int actual   = Tools.Max(image);
                Assert.AreEqual(expected, actual);
            }
        }