Exemple #1
0
        private void RotateImage(double deltaAngle)
        {
            Point mouse  = Mouse.GetPosition(ImagePanel);
            Point origin = TransGroup.Transform(mouse);

            RotateTrans.Angle += deltaAngle;

            // 位移补偿
            Point alter = TransGroup.Transform(mouse);

            TranslateImage(origin.X - alter.X, origin.Y - alter.Y);
        }
Exemple #2
0
        private void ScaleImage(double deltaMultiple)
        {
            Point mouse  = Mouse.GetPosition(ImagePanel);
            Point origin = TransGroup.Transform(mouse);

            ScaleTrans.ScaleX += deltaMultiple;
            ScaleTrans.ScaleY += deltaMultiple;

            // 位移补偿
            Point alter = TransGroup.Transform(mouse);

            TranslateImage(origin.X - alter.X, origin.Y - alter.Y);
        }