Exemplo n.º 1
0
 /// <summary>
 /// Push translate transformation to matrix
 /// </summary>
 /// <param name="x">horizontal coordinate value to transform by</param>
 /// <param name="y">vertical coordinate value to transform by</param>
 public void Translate(double x, double y)
 {
     if (currentTransform == null)
     {
         currentTransform = new Matrix3x3();
     }
     transformRequired = true;
     currentTransform.Translate(x, y);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Apply current transformation for (centerX, centerY) then skew at center point
        /// </summary>
        /// <param name="xSkewAngle">x skew angle (in degree)</param>
        /// <param name="ySkewAngle">y skew angle (in degree)</param>
        /// <param name="centerX">center point x coordinate</param>
        /// <param name="centerY">center point y coordinate</param>
        public void SkewPrepend(double xSkewAngle, double ySkewAngle, double centerX, double centerY)
        {
            if ((xSkewAngle != 0) || (ySkewAngle != 0))
            {
                Matrix3x3 matrix = new Matrix3x3();
                matrix.Translate(-centerX, -centerY);
                matrix.Skew(xSkewAngle, ySkewAngle);
                matrix.Translate(centerX, centerY);

                // then prepend multiply
                this.PrependSelfMultiply(matrix.Sx, matrix.Sy, matrix.Shx, matrix.Shy, matrix.Tx, matrix.Ty);
                //PrependSelfMultiply(1.0, 1.0,
                //    Math.Tan(xSkewAngle * DegreeToRadianFactor),
                //    Math.Tan(ySkewAngle * DegreeToRadianFactor),
                //    centerX, centerY);

                isChanged = true;

                SimpleScaleAndTranslateOnly = false;
                ScaleAndTransformOnly       = false;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Apply current transformation for (centerX, centerY) then skew at center point
        /// </summary>
        /// <param name="xSkewAngle">x skew angle (in degree)</param>
        /// <param name="ySkewAngle">y skew angle (in degree)</param>
        /// <param name="centerX">center point x coordinate</param>
        /// <param name="centerY">center point y coordinate</param>
        public void SkewPrepend(double xSkewAngle, double ySkewAngle, double centerX, double centerY)
        {
            if ((xSkewAngle != 0) || (ySkewAngle != 0))
            {
                Matrix3x3 matrix = new Matrix3x3();
                matrix.Translate(-centerX, -centerY);
                matrix.Skew(xSkewAngle, ySkewAngle);
                matrix.Translate(centerX, centerY);

                // then prepend multiply
                this.PrependSelfMultiply(matrix.Sx, matrix.Sy, matrix.Shx, matrix.Shy, matrix.Tx, matrix.Ty);
                //PrependSelfMultiply(1.0, 1.0,
                //    Math.Tan(xSkewAngle * DegreeToRadianFactor),
                //    Math.Tan(ySkewAngle * DegreeToRadianFactor),
                //    centerX, centerY);

                isChanged = true;

                SimpleScaleAndTranslateOnly = false;
                ScaleAndTransformOnly = false;
            }
        }