制作要点:
(1) 使用System.Windows.Threading.DispatcherTimer;
(2) 将Window属性设置为:
this.WindowState = WindowState.Maximized;
this.WindowStyle = WindowStyle.None;
this.ResizeMode = ResizeMode.NoResize;
(3) 按ESC键时,关闭窗口。
关键代码:
System.Windows.Threading.DispatcherTimer frameTimer;
int lastTick;
public Window1()
{
InitializeComponent();
this.WindowState = WindowState.Maximized;
this.WindowStyle = WindowStyle.None;
this.ResizeMode = ResizeMode.NoResize;
frameTimer = new System.Windows.Threading.DispatcherTimer();
frameTimer.Tick += OnFrame;
frameTimer.Interval = TimeSpan.FromSeconds(1.0 / 60.0);
frameTimer.Start();
this.lastTick = Environment.TickCount;
rand = new Random(this.GetHashCode());
this.Show();
this.KeyDown += new System.Windows.Input.KeyEventHandler(Window1_KeyDown);
//绘制屏保内容,可以是动画,也可以是动态更新的图片
// DrawingSomethings();
}
![]() 清爽风格非主流签名制作:淡淡的幸福 | ![]() [非主流照片教程]PS制作May风格 | ![]() 可爱非主流x-liu风格 | ![]() 非主流照片制作教程:单色个性篇 |
![]() 非主流照片教程:P出非主流风格效果 | ![]() 非主流照片教程:PS制作Sener非主流效果 | ![]() 简单的非主流浅黑白色调效果 | ![]() 非主流照片教程:baby kiss非主流效果 |