手机
当前位置:查字典教程网 >编程开发 >C#教程 >C#图像重新着色的方法
C#图像重新着色的方法
摘要:本文实例讲述了C#图像重新着色的方法。分享给大家供大家参考。具体实现方法如下:usingSystem;usingSystem.Collect...

本文实例讲述了C#图像重新着色的方法。分享给大家供大家参考。具体实现方法如下:

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; using System.Drawing.Imaging; namespace WindowsApplication2 { public partial class Form18 : Form { public Form18() { InitializeComponent(); } private void panel1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; using (Bitmap bmp = new Bitmap(@"d:/我的文档/桌面/ico/Administrator.bmp")) { ColorMap[] colorMap = new ColorMap[1]; colorMap[0] = new ColorMap(); colorMap[0].OldColor = Color.Blue; colorMap[0].NewColor = Color.White; ImageAttributes attr = new ImageAttributes(); attr.SetRemapTable(colorMap); Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height); rect.Offset(0, 0); g.DrawImage(bmp, rect, 0, 0, rect.Width, rect.Height, g.PageUnit, attr); } } } }

希望本文所述对大家的C#程序设计有所帮助。

【C#图像重新着色的方法】相关文章:

C# 将字节流转换为图片的实例方法

c#中虚函数的相关使用方法

C#定位txt指定行的方法小例子

C#生成sitemap站点地图的方法

用C#编写获取远程IP,MAC的方法

C#.NET字符串比较中忽略符号的方法

C#对XML文件的各种操作实现方法

c#.net 常用函数和方法集

C# 向二进制文件进行读写的操作方法

C# 读取指定路径配置文件的方法

精品推荐
分类导航