WPF 背景换肤
来源:互联网 发布:淘宝主机哪家好 编辑:程序博客网 时间:2024/05/02 19:25
最近做了个小项目,用到实时换背景,遇到的问题解决,代码:
ImageBrush imageBrush = new ImageBrush();
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(file, UriKind.Absolute);
//
bi.CacheOption = BitmapCacheOption.OnLoad;
//以下代码必须有,忽略系统缓冲,否则背景有时在缓冲的影响下,替换不了
bi.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
bi.EndInit();
imageBrush.ImageSource = bi;
imageBrush.Stretch = Stretch.Fill;
this.Background = imageBrush ;
0 0
- WPF 背景换肤
- WPF 换肤
- WPF style 换肤
- WPF中的动态换肤
- WPF 单个模块换肤
- wpf本地程序换肤(换语言)笔记
- wpf多语言和换肤
- WPF换肤的简单实例
- WPF的DEV换肤 连WPF自带控件一起换肤
- 换背景颜色
- onmousemove 换背景
- vs2010 换背景
- photoshopCS5换背景
- 给照片换背景
- WPF学习篇 之 自定义控件 动态换肤
- WPF实现动态换肤功能(一)
- WPF换肤之一:创建圆角窗体
- WPF换肤之二:可拉动的窗体
- ios开发中关于UIKit手势的介绍
- Python入门资料
- A superb web-based MSC tool
- 搞笑文章
- RTSP协议
- WPF 背景换肤
- 一个UNIX环境下编译动态brew app的…
- 今天大爷我做东
- SJWC online materials
- 央视报道:全国22家奶粉厂家69批次…
- 明报:伊利雪條含三聚氰胺需回收
- 吴大师, 英熊北游, 谁操了谁?
- 彻底搞懂红黑树(一)
- 关于三聚氰胺