在窗体上绘背景图案
来源:互联网 发布:osx rar解压软件 编辑:程序博客网 时间:2024/04/30 09:16
在一个窗体上绘制背景图,是一项很有用的功能
首先在你的工程里添加背景图片,然后右击选择生成类型为嵌入式资源
记得添加名称空间
using System.Reflection;
然后获取嵌入式图片资源
首先在你的工程里添加背景图片,然后右击选择生成类型为嵌入式资源
记得添加名称空间
using System.Reflection;
然后获取嵌入式图片资源
1private Image backgroundImage;
2 backgroundImage = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("BkgndImage.7009.gif"));
2 backgroundImage = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("BkgndImage.7009.gif"));
最后一步就是绘制背景了
1protected override void OnPaint(PaintEventArgs e)
2 {
3 e.Graphics.DrawImage(backgroundImage, this.ClientRectangle, new Rectangle(0, 0, this.backgroundImage.Width, this.backgroundImage.Height), GraphicsUnit.Pixel);
4 }
2 {
3 e.Graphics.DrawImage(backgroundImage, this.ClientRectangle, new Rectangle(0, 0, this.backgroundImage.Width, this.backgroundImage.Height), GraphicsUnit.Pixel);
4 }
- 在窗体上绘背景图案
- 在屏幕上输出图案
- 【C】在屏幕上输出以下图案(菱形图案)
- 在屏幕上输出以下图案
- c语言:在屏幕上输出图案
- 在屏幕上输出以下图案: * *** ***** ******* ********* *********** ************* ********
- 在屏幕上输出以下图案: * *** ***** ******* ********* *********** ************* **********
- 在屏幕上用"*"输出菱形图案
- 在屏幕上用"*"输出菱形图案
- 在屏幕上输出以下图案: * *** ***** ******* ********* *********** ************* *********** *********
- 1.在屏幕上输出以下图案: // * // *** // ***** // ******* // ********* // *********** //*********
- 在屏幕上输出以下图案*
- 怎样在VB中设计背景动画图案
- 怎样在VB中设计背景动画图案
- DinPattern-背景图案下载
- 文件夹背景图案设置
- 页面背景图案网址
- css3背景图案
- ExtTree右键菜单
- 让InfoMaker成为您的报表设计利器[转]
- eXtremeComponents指南
- C/C++一些知识1
- Ruby on rails开发从头来(五十七)- ActiveRecord基础(多对多关联关系)
- 在窗体上绘背景图案
- dev c++ 数据类型的范围
- 截获全局鼠标消息研究
- 进程操作
- TGEA 笔记一
- Ruby on rails开发从头来(五十八)- ActiveRecord基础(自关联)
- RTP:实时应用程序传输协议
- JS倒计时
- .net 在页面基类中注册样式文件