设置 ScaleTransform.ScaleXProperty 动画的代码
来源:互联网 发布:华道数据工作怎么样 编辑:程序博客网 时间:2024/05/21 00:21
2009-08-18 21:14:47 来自:逆风的蝴蝶 浏览数:21次
NameScope.SetNameScope(this, new NameScope());
Button button1 = new Button();
button1.Width = 100;
button1.Height = 100;
button1.Content = "fds";
button1.Name = "button1";
c1.Children.Add(button1);
button1.RenderTransform = new TranslateTransform();
this.RegisterName(button1.Name, button1);
Storyboard story = new Storyboard();
story.AutoReverse = true;
story.RepeatBehavior = RepeatBehavior.Forever;
DoubleAnimation yAnimation = new DoubleAnimation();//子动画
yAnimation.From = 0;
yAnimation.To = 100;
yAnimation.Duration = new Duration(TimeSpan.FromSeconds(10));
DependencyProperty[] propertyChain =
new DependencyProperty[] { Button.RenderTransformProperty,
TransformGroup.ChildrenProperty,
ScaleTransform.ScaleXProperty};
string thePath = "(0).(1)[0].(2)";
Storyboard.SetTargetName(yAnimation, button1.Name);
Storyboard.SetTargetProperty(yAnimation, new PropertyPath(thePath, propertyChain));
story.Children.Add(yAnimation);
story.Begin(this);
调试时报错 {"路径“(0).(1)[0].(2)”中的“Children”属性值指向“System.Windows.Media.TransformCollection”的不可变实例。"}
Button button1 = new Button();
button1.Width = 100;
button1.Height = 100;
button1.Content = "fds";
button1.Name = "button1";
c1.Children.Add(button1);
button1.RenderTransform = new TranslateTransform();
this.RegisterName(button1.Name, button1);
Storyboard story = new Storyboard();
story.AutoReverse = true;
story.RepeatBehavior = RepeatBehavior.Forever;
DoubleAnimation yAnimation = new DoubleAnimation();//子动画
yAnimation.From = 0;
yAnimation.To = 100;
yAnimation.Duration = new Duration(TimeSpan.FromSeconds(10));
DependencyProperty[] propertyChain =
new DependencyProperty[] { Button.RenderTransformProperty,
TransformGroup.ChildrenProperty,
ScaleTransform.ScaleXProperty};
string thePath = "(0).(1)[0].(2)";
Storyboard.SetTargetName(yAnimation, button1.Name);
Storyboard.SetTargetProperty(yAnimation, new PropertyPath(thePath, propertyChain));
story.Children.Add(yAnimation);
story.Begin(this);
调试时报错 {"路径“(0).(1)[0].(2)”中的“Children”属性值指向“System.Windows.Media.TransformCollection”的不可变实例。"}
- 设置 ScaleTransform.ScaleXProperty 动画的代码
- silverlight应用(二):ScaleTransform动画
- Graphics.PageScale Graphics.ScaleTransform 的区别
- Silverlight & Blend动画设计系列三:缩放动画(ScaleTransform)
- Silverlight & Blend动画设计系列三:缩放动画(ScaleTransform)
- 代码设置Dialog的进入和退出动画
- android 代码中设置动画
- silverlight Scaletransform
- 动画的设置 pop
- 动画的设置
- 设置弹出的动画
- 模型的动画设置
- 在代码中设置补间动画
- 在代码中设置逐帧动画
- Popupwindow的动画的设置
- c#,利用WPF的ScaleTransform和TranslateTransform实现图片的缩放效果
- Graph.DrawString在graph在不同scaletransform情况下出来结果不一样的问题
- silverlight 中 物件儿的位置变换 TransformGroup,RotateTransform 和 ScaleTransform 用C#
- 使用duilib出现“error C2872: 'CRect' : ambiguous symbol”等错误
- POSTGIS教程
- Three20简单介绍TTTableViewController
- 【二分】Garland
- C语言 实现 面向对象编程 OOC
- 设置 ScaleTransform.ScaleXProperty 动画的代码
- Visual Studio 2010构建Web浏览器应用程序
- 深入浅出Visual C++动态链接库(Dll)编程之三:MFC规则DLL
- 胡思乱想
- 线性判别分析(LDA), 主成分分析(PCA)
- 我们到底应该不应该吃狗肉呢
- 关于_ReturnAddress的error C2733
- windows下快速删除rhsa属性文件 如 com1.gupiao.asp
- 本体库(理论篇)