C# WPF 后台代码怎样实现 RenderTransform 效果呢?

2024-12-12 15:32:24
推荐回答(1个)
回答1:

        public MainWindow()
        {
            InitializeComponent();
            //grid1里面的button反过来了
            grid1.RenderTransformOrigin = new Point(0.5, 0.5);
            ScaleTransform sctr = new ScaleTransform();
            sctr.ScaleY = 1;
            sctr.ScaleX = -1;
            TransformGroup trfg = new TransformGroup();
            trfg.Children.Add(sctr);
            grid1.RenderTransform = trfg;
        }