Exemple #1
0
        public void BaseTestResize(IPicture input, IPicture Compare, double scaleX, double scaleY)
        {
            input.Resize(scaleX, scaleY);

            IClientAnchor inpCA = input.ClientAnchor;
            IClientAnchor cmpCA = Compare.ClientAnchor;

            Size inpDim = ImageUtils.GetDimensionFromAnchor(input);
            Size cmpDim = ImageUtils.GetDimensionFromAnchor(Compare);

            double emuPX = Units.EMU_PER_PIXEL;

            Assert.AreEqual(inpDim.Height, cmpDim.Height, emuPX * 6, "the image height differs");
            Assert.AreEqual(inpDim.Width, cmpDim.Width, emuPX * 6, "the image width differs");
            Assert.AreEqual(inpCA.Col1, cmpCA.Col1, "the starting column differs");
            Assert.AreEqual(inpCA.Dx1, cmpCA.Dx1, 1, "the column x-offset differs");
            Assert.AreEqual(inpCA.Dy1, cmpCA.Dy1, 1, "the column y-offset differs");
            Assert.AreEqual(inpCA.Col2, cmpCA.Col2, "the ending columns differs");
            // can't compare row heights because of variable test heights

            input.Resize();
            inpDim = ImageUtils.GetDimensionFromAnchor(input);

            Size imgDim = input.GetImageDimension();

            Assert.AreEqual(imgDim.Height, inpDim.Height / emuPX, 1, "the image height differs");
            Assert.AreEqual(imgDim.Width, inpDim.Width / emuPX, 1, "the image width differs");
        }
Exemple #2
0
        public void BaseTestResize(IPicture input, IPicture Compare, double scaleX, double scaleY)
        {
            input.Resize(scaleX, scaleY);

            IClientAnchor inpCA = input.ClientAnchor;
            IClientAnchor cmpCA = Compare.ClientAnchor;

            Size inpDim = ImageUtils.GetDimensionFromAnchor(input);
            Size cmpDim = ImageUtils.GetDimensionFromAnchor(Compare);

            double emuPX = Units.EMU_PER_PIXEL;

            Assert.AreEqual(inpDim.Height, cmpDim.Height, emuPX * 6, "the image height differs");
            Assert.AreEqual(inpDim.Width, cmpDim.Width, emuPX * 6, "the image width differs");
            Assert.AreEqual(inpCA.Col1, cmpCA.Col1, "the starting column differs");
            Assert.AreEqual(inpCA.Dx1, cmpCA.Dx1, 1, "the column x-offset differs");
            Assert.AreEqual(inpCA.Dy1, cmpCA.Dy1, 1, "the column y-offset differs");
            Assert.AreEqual(inpCA.Col2, cmpCA.Col2, "the ending columns differs");
            // can't compare row heights because of variable test heights

            input.Resize();
            inpDim = ImageUtils.GetDimensionFromAnchor(input);

            Size imgDim = input.GetImageDimension();

            Assert.AreEqual(imgDim.Height, inpDim.Height / emuPX, 1, "the image height differs");
            Assert.AreEqual(imgDim.Width, inpDim.Width / emuPX, 1, "the image width differs");
        }