Ejemplo n.º 1
0
        public void FastBitmapModificationsAreApplied()
        {
            List <string> files = new List <string>
            {
                ImageSources.GetFilePathByName("format-Penguins.jpg"),
                ImageSources.GetFilePathByName("format-Penguins.png"),
            };

            foreach (string file in files)
            {
                Bitmap bmp      = new Bitmap(file);
                Bitmap original = (Bitmap)bmp.Clone();

                using (FastBitmap fbmp = new FastBitmap(bmp))
                {
                    // draw a pink diagonal line
                    for (int i = 0; i < 10; i++)
                    {
                        fbmp.SetPixel(i, i, Color.Pink);
                    }
                }

                AssertionHelpers.AssertImagesAreDifferent(original, bmp, "because modifying the fast bitmap should have modified the original bitmap");
            }
        }
Ejemplo n.º 2
0
        public void FastBitmapModificationsAreApplied(string file)
        {
            Bitmap bmp      = new Bitmap(file);
            Bitmap original = (Bitmap)bmp.Clone();

            using (FastBitmap fbmp = new FastBitmap(bmp))
            {
                // draw a pink diagonal line
                for (int i = 0; i < 10; i++)
                {
                    fbmp.SetPixel(i, i, Color.Pink);
                }
            }

            AssertionHelpers.AssertImagesAreDifferent(original, bmp, "because modifying the fast bitmap should have modified the original bitmap");
        }