以编程方式在WPF中创建偏斜变换 [英] Create skew tranformation in WPF programatically
本文介绍了以编程方式在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屋!
查看全文