WPF Clip实现百叶窗
来源:互联网 发布:知识库软件 编辑:程序博客网 时间:2024/04/27 05:40
效果图;
后台代码:
public MainWindow()
{
InitializeComponent();
pg = new PathGeometry();
timer = new DispatcherTimer();
}
PathGeometry pg = null;
DispatcherTimer timer = null;
//设置矩形的大小
double size = 100;
//矩形的初始宽度
double size1 = 0;
private void button1_Click(object sender, RoutedEventArgs e)
{
if (pg != null)
{
pg.Clear();
}
timer.Interval = TimeSpan.FromMilliseconds(1);
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}
private void timer_Tick(object sender, EventArgs e)
{
if (size1 <= size)
{
for (int i = 0; i < Math.Ceiling(image1.Width / size); i++)
{
RectangleGeometry rg = new RectangleGeometry();
//设置矩形区域大小
rg.Rect = new Rect(i * size, 0, size1, image1.Height);
//合并几何图形
pg = Geometry.Combine(pg, rg, GeometryCombineMode.Union, null);
image1.Clip = pg;
}
}
else
{
timer.Stop();
size1 = 0;
}
size1++;
}
}
根据这个效果,上下百叶窗效果也很容易实现,并改变白色矩形形状也就容易多了,剩下自己研究吧。
- WPF Clip实现百叶窗
- WPF 用Clip属性实现蒙板特效
- WPF Clip属性
- 实现百叶窗效果图
- asp百叶窗实现
- J2ME实现百叶窗效果
- Jquery 百叶窗实现原理
- js实现百叶窗
- html实现百叶窗效果
- 百叶窗
- 网页图片实现百叶窗效果
- 利用Jquery实现百叶窗效果
- clip协议实现
- 用JavaScript实现页面百叶窗效果
- 用VB实现“百叶窗”的图形特效
- 用VB实现“百叶窗”的图形特效
- AS3.0实现百叶窗过渡效果
- python 简单实现 图片百叶窗效果
- UltraEdit-32 (简体中文)V21.10.1027 绿色单文件破解版
- STL容器介绍
- c++文件读写基本操作
- Android自定义组件系列【7】——进阶实践(4)
- 深入研究Clang(三) libclang
- WPF Clip实现百叶窗
- 《中国最狂的总裁---马云》阅读笔记
- ios UIKit框架分析 第5天
- Log4j.properties配置详解和实例
- php类的创建和使用--php学习笔记(1)
- TortoiseSVN使用教程简易入门(一)
- 【IPC进程间通讯之二】管道Pipe
- Photoshop小技巧集锦八十条
- 使用java发送email