示例#1
0
        public void TextureHandler_Bmp_ResizeDown()
        {
            TextureHandler t1 = new TextureHandler(Path.Combine(localFolder, image_bmp_1));

            t1.Resize(8, 8, true);
            t1.Save(Path.Combine(localFolder, image_bmp_1_small_out), ImageFormat.Bmp);
            t1.Dispose();

            Bitmap original = new Bitmap(Path.Combine(localFolder, image_bmp_1_small));
            Bitmap output   = new Bitmap(Path.Combine(localFolder, image_bmp_1_small_out));

            BitmapAssert.AreEqual(original, output, 128, "Written image should be like the reference.");

            // cleanup - dispose of the bitmaps
            original.Dispose();
            output.Dispose();
        }
示例#2
0
        public void TextureHandler_Bmp_ResizeUp()
        {
            // RL: This is a stress test, if it doesn't pass, it's not the end of the world as
            // most video card/driver will handle the upscaling very differently.
            TextureHandler t1 = new TextureHandler(Path.Combine(localFolder, image_bmp_1));

            t1.Resize(32, 32, true);
            t1.Save(Path.Combine(localFolder, image_bmp_1_big_out), ImageFormat.Bmp);
            t1.Dispose();

            Bitmap original = new Bitmap(Path.Combine(localFolder, image_bmp_1_big));
            Bitmap output   = new Bitmap(Path.Combine(localFolder, image_bmp_1_big_out));

            BitmapAssert.AreEqual(original, output, 200, "Written image should be like the reference.");

            // cleanup - dispose of the bitmaps
            original.Dispose();
            output.Dispose();
        }