以编程方式在WPF中创建偏斜变换 [英] Create skew tranformation in WPF programatically

查看:86
本文介绍了以编程方式在WPF中创建偏斜变换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以编程方式在WPF中创建一个偏斜转换,以便打开时窗口翻转.我已经使用以下代码创建了一个淡入淡出的动画

 公共 静态  void  FadeIn( UIElement targetControl)
        {
            DoubleAnimation fadeInAnimation =  DoubleAnimation( 0  1 持续时间(TimeSpan.FromSeconds( 1 . 5 ))));
            Storyboard.SetTarget(fadeInAnimation,targetControl);
            Storyboard.SetTargetProperty(fadeInAnimation, PropertyPath(UIElement.OpacityProperty));
            情节提要sb = 情节提要();
            sb.Children.Add(fadeInAnimation);
            sb.Begin();
        } 



我想使倾斜方法与上述相同,并且也位于标题上方,因此当我调用此函数时边框不具有动画效果

像这样

 公共 部分  class  childWindow1:窗口
    {
        公共 childWindow1()
        {
            InitializeComponent();

             .FadeIn();


        } 

解决方案

1. 从C#– WPF对多个转换进行动画处理 [ ^ ]
2. 动画SkewTransform示例 [ SkewTransform类 [public static void FadeIn(this UIElement targetControl) { DoubleAnimation fadeInAnimation = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(1.5))); Storyboard.SetTarget(fadeInAnimation, targetControl); Storyboard.SetTargetProperty(fadeInAnimation, new PropertyPath(UIElement.OpacityProperty)); Storyboard sb = new Storyboard(); sb.Children.Add(fadeInAnimation); sb.Begin(); }



an i wanted to make a skew method same as above and also in above the tittle and the border is not animated when i call this function

like this

public partial class childWindow1 : Window
    {
        public childWindow1()
        {
            InitializeComponent();

            this.FadeIn();


        }

解决方案

1. Animate multiple transforms from C# – WPF[^]
2. Animated SkewTransform Example[^]

SkewTransform Class[^]


这篇关于以编程方式在WPF中创建偏斜变换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆