Winform画背景图片的两种方法TextureBrush与Graphics.DrawImage()
来源:互联网 发布:python中class的用法 编辑:程序博客网 时间:2024/06/05 20:23
1, 使用drawImage的例子:
private void DrawImage(Graphics g) { if (backImg == null) return; else this.Size = backImg.Size; Rectangle r = new Rectangle(0,0, this.Size.Width, this.Size.Height); g.DrawImage(backImg, r); }
2, 使用TextureBrush的例子:
using (Image image = Image.FromFile(@"e:\pic.jpg")) { using (TextureBrush brush = new TextureBrush(image)) { brush.TranslateTransform(x, y); g.FillRectangle(brush, x, y, image.Width, image.Height); g.Restore(state); } }
简单区别参考:http://www.cnblogs.com/xingd/archive/2005/02/02/101047.html
- Winform画背景图片的两种方法TextureBrush与Graphics.DrawImage()
- Graphics::DrawImage()函数的使用
- android 改变背景图片的两种方法
- GDI+中Graphics::DrawImage的BUG
- C#Graphics.DrawImage的一些问题
- Graphics.DrawImage函数其中一种的用法
- winform 快捷键的两种实现方法
- java绘图之paint(Graphics g)与Graphics g=getGraphics()的两种画笔获取
- Graphics.DrawImage 方法 IntPtr 结构 GDI 句柄 知识收集
- 测试Canvas的drawImage方法
- 利用 Graphics 的 DrawImage 生成高质量的缩略图。
- 两种方法实现UIView插入背景图片
- DrawImage BitBlt StretchBlt画PNG图片的方法
- DrawImage BitBlt StretchBlt画PNG图片的方法
- DrawImage BitBlt StretchBlt画PNG图片的方法
- DrawImage BitBlt StretchBlt画PNG图片的方法
- drawImage()方法
- C# winForm 自定义鼠标样式的两种方法
- STM32 启动代码发分析
- i++在VS2005和ADS v1.2编译环境下的误区
- android java打印栈信息
- 什么是meta
- 函数指针(C++)
- Winform画背景图片的两种方法TextureBrush与Graphics.DrawImage()
- SMALI语法点滴
- C++本质:类的赋值运算符=的重载,以及深拷贝和浅拷贝
- 现有的画笔和创建自己的画笔6zhongGDI
- ASP.net的窗体身份验证
- 博弈论(1)
- 马桶与音乐的结合:马桶型迷你小音箱
- C内存分配方式
- 存储类型与存储区bit