透明背景图像绘制(C#)
2011-03-26 09:57
375 查看
ImageAttributes vAttr = new ImageAttributes(); //vAttr是关键 //图像中与0,0那点相同的颜色要变成透明 vAttr.SetColorKey(((Bitmap)pictureBox1.Image).GetPixel(0, 0), ((Bitmap)pictureBox1.Image).GetPixel(0, 0)); //绘制透明的图像 e.Graphics.DrawImage(pictureBox1.Image , new Rectangle(10, 10, pictureBox1.Width, pictureBox1.Height) , 0, 0, pictureBox1.Image.Width, pictureBox1.Image.Height , GraphicsUnit.Pixel , vAttr);
完整的例子程序下载(Sample00002.rar)
相关文章推荐
- [C#]桌面模式下GDI绘制(全透明背景)
- 在图像中绘制透明白色背景
- C#绘制半透明窗体,只让窗体背景半透明,而窗体里面的控件不透明
- C# 透明背景Panel, 透明图像, PitureBox透明效果
- VS2005 C# 使MenuStrip中的图标背景透明
- C# png格式图像转jpg时透明背景变为黑色问题
- java SWT:基于Composite定制背景透明的浮动图像按钮(image button)
- 背景透明的ListBox(C#.WinForm)
- C# WinForm 自定义控件,DataGridView背景透明,TabControl背景透明
- j2me 绘制透明的背景
- C#绘制透明区域
- C#判断一个图像是否是透明的GIF图的方法
- MFC为子窗口绘制透明背景
- c#解决窗口背景贴图刷新,放大后图像闪烁问题
- C#叠加图片,背景为透明的
- C# 产生验证码 利用背景图片绘制
- C# 使用.NET性能计数器示例 绘制出正弦函数图像
- C# Winform中如何让PictureBox的背景透明
- VS2005 C# WEB swf 文件背景透明
- Java Graphics2D绘制背景透明的图形过程