第12章 形状、画刷和变换(2)——变换元素
来源:互联网 发布:centos 6.5 漏洞 编辑:程序博客网 时间:2024/06/07 23:01
一、变换元素概述
①变换元素可以使用RenderTransform属性实现变换。
②变换元素也可以使用LayoutTransform属性,它以相同的方式变换元素,但在布局之前执行其工作。
③在一定程度上,当设置RenderTransform属性和LayoutTransform属性时,WPF不知道它们正在被修改。特别是,变换不会影响元素的ActualHeight和ActualWidth属性,它们仍记录着变换之前的值。
二、实例代码
<Window x:Class="Drawing.RotateElement" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="RotateElement" Height="314" Width="305" > <StackPanel> <StackPanel Margin="25" Background="LightYellow"> <Button Padding="5" HorizontalAlignment="Left"> <Button.RenderTransform> <RotateTransform Angle="35" CenterX="45" CenterY="5" /> </Button.RenderTransform> <Button.Content>I'm rotated 35 degrees</Button.Content> </Button> <Button Padding="5" HorizontalAlignment="Left">I'm not</Button> </StackPanel> <StackPanel Margin="25" Background="LightYellow"> <Button Padding="5" HorizontalAlignment="Left"> <Button.LayoutTransform> <RotateTransform Angle="35" CenterX="45" CenterY="5" /> </Button.LayoutTransform> <Button.Content>I'm rotated 35 degrees</Button.Content> </Button> <Button Padding="5" HorizontalAlignment="Left">I'm not</Button> </StackPanel> </StackPanel></Window>三、效果演示
0 0
- 第12章 形状、画刷和变换(2)——变换元素
- 第12章 形状、画刷和变换(1)——变换形状
- WPF画刷、形状和变换学习笔记
- 详解OpenGL中的各种变换(投影变换,模型变换,视图变换)(一)——模型变换和视图变换
- c#形状原点变换
- 第3章—形状和模型
- Opencv——仿射变换和透视变换
- Opencv学习——仿射变换和透视变换
- 光照不均匀图像分割技巧2——顶帽变换和底帽变换
- 第6章/图像变换
- 第6章 变换编码
- 第6章 变换编码
- OpenGL图形变换——几何变换(世界变换)
- 【C++】容器元素的复制和变换
- 【C++】容器元素的复制和变换
- 图像变换——对数变换
- 图像变换——仿射变换
- 灰度变换——对数变换
- JS常用的自定义函数addClass() insertAfter() addLoadEvent(func)
- Myeclipse中.xml文件配置错误,出现"context:property-placeholder" is not bound错误
- UISegmentedControl
- 一个完整Android项目所需要用到的gradle配置技巧
- POJ 3911 Internet Service Providers 可能会
- 第12章 形状、画刷和变换(2)——变换元素
- 抽象类与接口
- poj1837动态规划
- 码农日记-1
- Taglib自定义标签之一
- 延迟函数(图片的延迟显示动画效果)
- MAC MySQL安装及配置
- 蓝桥杯 2015 省赛 6 牌型种数
- 深入理解各种排序