Пример #1
0
 private void BtnExtraBlurry_Click(object sender, EventArgs e)
 {
     manipulated         = ImageManipulations.MakeExtraBlurry(original);
     currentManipulation = "_extra_blurry";
     pbManipulated.Image = manipulated;
     manipulationMade    = true;
 }
Пример #2
0
        public void ExtraBlurryWorks()
        {
            Color white = Color.FromArgb(255, 255, 255);
            Color black = Color.FromArgb(0, 0, 0);

            Color[,] assignColors =
            {
                { white, white, black, white, white },
                { white, white, black, white, white },
                { white, white, black, white, white },
                { white, white, black, white, white },
                { white, white, black, white, white }
            };

            Bitmap original = CreateImage(5, 5, assignColors);
            Bitmap actual   = ImageManipulations.MakeExtraBlurry(original);

            for (int y = 0; y < actual.Height; y++)
            {
                for (int x = 0; x < actual.Width; x++)
                {
                    int colorSum = actual.GetPixel(x, y).R + actual.GetPixel(x, y).G + actual.GetPixel(x, y).B;

                    if (colorSum > 0 && colorSum < 765)
                    {
                    }
                    else
                    {
                        Assert.Fail();
                    }
                }
            }
            Assert.Pass();
        }