Пример #1
0
        public virtual void GetAffineTransformDifferentWidthHeightTest()
        {
            Transform transform = new Transform(1);

            transform.AddSingleTransform(CreateSingleTransform(UnitValue.CreatePercentValue(20f), UnitValue.CreatePercentValue
                                                                   (30f)));
            NUnit.Framework.Assert.AreEqual(new AffineTransform(new float[] { -2f, 3f, -4f, -5f, -10f, -6f, type }), Transform
                                            .GetAffineTransform(transform, -50f, -20f));
            NUnit.Framework.Assert.AreEqual(new AffineTransform(new float[] { -2f, 3f, -4f, -5f, 10f, -6f, type }), Transform
                                            .GetAffineTransform(transform, 50f, -20f));
            NUnit.Framework.Assert.AreEqual(new AffineTransform(new float[] { -2f, 3f, -4f, -5f, -10f, 6f, type }), Transform
                                            .GetAffineTransform(transform, -50f, 20f));
            NUnit.Framework.Assert.AreEqual(new AffineTransform(new float[] { -2f, 3f, -4f, -5f, 10f, 6f, type }), Transform
                                            .GetAffineTransform(transform, 50f, 20f));
        }
Пример #2
0
        public virtual void GetAffineTransformDiffSingleTransformTest()
        {
            float     txUnitValue  = 20f;
            float     tyUnitValue2 = 30f;
            Transform transform    = new Transform(4);

            transform.AddSingleTransform(CreateSingleTransform(UnitValue.CreatePercentValue(txUnitValue), UnitValue.CreatePointValue
                                                                   (tyUnitValue2)));
            transform.AddSingleTransform(CreateSingleTransform(UnitValue.CreatePointValue(txUnitValue), UnitValue.CreatePercentValue
                                                                   (tyUnitValue2)));
            transform.AddSingleTransform(CreateSingleTransform(UnitValue.CreatePercentValue(txUnitValue), UnitValue.CreatePercentValue
                                                                   (tyUnitValue2)));
            transform.AddSingleTransform(CreateSingleTransform(UnitValue.CreatePointValue(txUnitValue), UnitValue.CreatePointValue
                                                                   (tyUnitValue2)));
            NUnit.Framework.Assert.AreEqual(new AffineTransform(new float[] { -524f, -105f, 140f, -419f, -788f, 2220f,
                                                                              type }), Transform.GetAffineTransform(transform, 60f, 80f));
        }