Example #1
0
        public void ApplyGrayscale()
        {
            var oldR = LargeBitmap.GetPixel(0, 0).R;
            var oldG = LargeBitmap.GetPixel(0, 0).G;
            var oldB = LargeBitmap.GetPixel(0, 0).B;

            int intensity = (oldR + oldG + oldB) / 3;
            int newR      = intensity;
            int newG      = intensity;
            int newB      = intensity;

            ImageHandler.ApplyGrayscale(LargeBitmap);
            Assert.AreEqual(newR, LargeBitmap.GetPixel(0, 0).R);
            Assert.AreEqual(newG, LargeBitmap.GetPixel(0, 0).G);
            Assert.AreEqual(newB, LargeBitmap.GetPixel(0, 0).B);
        }