第三篇 一个屏幕开满玫瑰花的程序
来源:互联网 发布:老子 知乎 编辑:程序博客网 时间:2024/04/28 05:02
思路:窗体全屏且透明,在窗体中随机绘制图片、
代码:
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using Rose.net3.Properties;using System.Windows.Forms.VisualStyles;namespace Rose.net3{ public partial class Form1 : Form { private static readonly int WIDTH = Screen.PrimaryScreen.WorkingArea.Width; private static readonly int HEIGHT = Screen.PrimaryScreen.WorkingArea.Height; private static int i = 0; Timer timer = new Timer(); private Random random = new Random(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.Width = WIDTH; this.Height = HEIGHT; this.TransparencyKey = this.BackColor; this.StartPosition = FormStartPosition.CenterScreen; this.Location=new Point(1,1); timer.Tick += new EventHandler(timer_Tick); timer.Interval = 100; timer.Start(); } void timer_Tick(object sender, EventArgs e) { i++; int x = random.Next(-10, WIDTH - 100); int y = random.Next(-10, HEIGHT - 100); Graphics gr; gr = CreateGraphics(); gr.DrawImage(Resources.Rose,new Point(x,y)); if (i == 100) { timer.Stop(); } } private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode== Keys.Escape) { this.Close(); } } }}
- 第三篇 一个屏幕开满玫瑰花的程序
- 桌面开满玫瑰花小程序之小小总结
- 玫瑰花程序
- 玫瑰花Java web程序
- 情人节节玫瑰花屏幕保护
- [GDI+] 一个基于MFC、GDI+的粒子系统:玫瑰花满屏飞舞 (情人节送祝福的绝佳利器)
- 一个简易的屏幕录制程序
- 实现一个简单的屏幕截图程序
- 灰色的玫瑰花
- 玫瑰花的含义
- 玫瑰花的含义
- 灰色的玫瑰花
- 凋谢的玫瑰花
- Matlab画的玫瑰花
- 玫瑰花的含义
- 玫瑰花的魅力
- 陌生人的玫瑰花
- 1360 xth 的玫瑰花
- 开始着手Oracle中Scott用户的管理系统
- java正则表达式
- 如何在Oracle中使用Java存储过程 (详解) .
- rtp中的负载类型及时间戳
- 新版Axure7.0下载
- 第三篇 一个屏幕开满玫瑰花的程序
- Redis 设计与实现
- java匿名内部类
- ftok函数说明
- Visual C++实现微秒级精度定时器
- Android 壁纸设置代码 详解
- poj 3525 Most Distant Point from the Sea(半平面交+二分)
- Object instanceof Function 还是 Function instance of Object,是真是假
- 为SQLServer创建视图