/// <summary> /// 撤销 /// </summary> public void undo() { TransformGroup transform = (TransformGroup)image.RenderTransform; TransformCollection transformcollection = transform.Children; transformcollection.RemoveAt(transformcollection.Count - 1); }
/// <summary> /// 是否真的旋转 /// </summary> /// <returns></returns> public bool isRealRotate() { TransformGroup transform = (TransformGroup)image.RenderTransform; TransformCollection transformcollection = transform.Children; //找到最后一个translate,判断是否发生旋转 RotateTransform translate = (RotateTransform)transformcollection[transform.Children.Count - 1]; if (Math.Abs(translate.Angle) < 0.0005) { transformcollection.RemoveAt(transformcollection.Count - 1); return(false); } return(true); }