Exemplo n.º 1
0
        private bool ReadCanonicalForm(Transform transform, bool useIfChangeable)
        {
            bool flag = false;

            if (CanonicalTransform.IsCanonical(transform))
            {
                TransformGroup     transformGroup     = (TransformGroup)transform;
                ScaleTransform     scaleTransform     = transformGroup.Children[0] as ScaleTransform;
                SkewTransform      skewTransform      = transformGroup.Children[1] as SkewTransform;
                RotateTransform    rotateTransform    = transformGroup.Children[2] as RotateTransform;
                TranslateTransform translateTransform = transformGroup.Children[3] as TranslateTransform;
                this.decomposition.Center        = new Point(scaleTransform.CenterX, scaleTransform.CenterY);
                this.decomposition.Scale         = new Vector(scaleTransform.ScaleX, scaleTransform.ScaleY);
                this.decomposition.Skew          = new Vector(skewTransform.AngleX, skewTransform.AngleY);
                this.decomposition.RotationAngle = rotateTransform.Angle;
                this.decomposition.Translation   = new Vector(translateTransform.X, translateTransform.Y);
                if (useIfChangeable && !transformGroup.IsFrozen)
                {
                    this.transformGroup = transformGroup;
                }
                else
                {
                    this.InitializeTransformGroup();
                }
                flag = true;
            }
            return(flag);
        }
Exemplo n.º 2
0
 public CanonicalTransform(CanonicalTransform canonicalTransform)
 {
     if (canonicalTransform == (CanonicalTransform)null)
     {
         this.Initialize();
     }
     else
     {
         this.decomposition = (CanonicalDecomposition)canonicalTransform.decomposition.Clone();
         this.InitializeTransformGroup();
     }
 }
Exemplo n.º 3
0
 public static bool Compare(CanonicalTransform ct1, CanonicalTransform ct2)
 {
     return(ct1 == ct2);
 }