/// <summary>
        /// 设置旋转角度和位置
        /// </summary>
        /// <param name="Angle">角度</param>
        /// <param name="CenterX">X轴偏移位置</param>
        /// <param name="CenterY">X轴偏移位置</param>
        /// <returns></returns>
        public TransformGroup SetAngleXY(double Angle, double CenterX, double CenterY)
        {
            TransformGroup tfGroup = new TransformGroup();
            RotateTransform rt = new RotateTransform();
            rt.Angle = Angle;
            rt.CenterX = CenterX;
            rt.CenterY = CenterY;
            tfGroup.Children.Add(rt);
            return tfGroup;
        }
         
         //用法:
         Canvas cvs = new Canvas();
         cvs.RenderTransform = SetAngleXY(180, 0, 0);

 

相关文章:

  • 2022-01-05
  • 2022-12-23
  • 2021-04-30
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案