易截截图软件、单文件、免安装、纯绿色、仅160KB

GDI+入门(C#高速处理版本)

首先感谢CSDN的朋友laviewpbt为我给我的建议。
laviewpbt提出使用getpixel处理速度太慢,上不了档次。
这里我再给大家写两种处理速度更快的图形处理方式。
下面是个内存操作灰度的程序:
bmp = new Bitmap(Application.StartupPath + "\\1.jpg");
            Bitmap bmp2 = (Bitmap)bmp.Clone();
            int width = bmp2.Width;
            int height = bmp2.Height;
            Rectangle rect = new Rectangle(0, 0, width, height);
            //用可读写的方式锁定全部位图像素
            BitmapData bmpData = bmp2.LockBits(rect, ImageLockMode.ReadWrite, bmp2.PixelFormat);
            //得到首地址
            IntPtr ptr = bmpData.Scan0;
            //24位bmp位图字节数
            int bytes = width * height * 3;
            byte[] rgbValues = new byte[bytes];
            Marshal.Copy(ptr, rgbValues, 0, bytes);
            //灰度化
            double colorTemp = 0;
            for (int i = 0; i < bytes; i += 3)
            {
                colorTemp = rgbValues[i + 2] * 0.299 + rgbValues[i + 1] * 0.587 + rgbValues[i] * 0.114;
&


相关文档:

C#操作xml

在C#.net中如何操作XML
需要添加的命名空间:
using System.Xml;
定义几个公共对象:
XmlDocument xmldoc ;
XmlNode xmlnode ;
XmlElement xmlelem ;
1,创建到服务器同名目录下的xml文件:
方法一:
xmldoc = new XmlDocument ( ) ;
//加入XML的声明段落
xmlnode = xmldoc.CreateNode ( XmlNodeType.XmlDeclara ......

提高c#的要点



提高C#编程水平的50个要点


1.总是用属性 (Property) 来代替可访问的数据成员
2.在  readonly 和 const 之间,优先使用 readonly
3.在 as 和 强制类型转换之间,优先使用 as 操作符
4.使用条件属性 (Conditional Attributes ......

基于C#的MapInfo开发时常用的命名空间总结


命名空间:  MapInfo.Data
MapInfo.Data 命名空间包含了实现 MapInfo .NET 数据提供方的类和接口。 对 MapInfo 数据的访问有两种形式:作为使用 SQL 与数据交互的 ADO.NET 数据提供程序和作为使用类与数据交互的 Feature 对象。 MapIn ......

C#利用webrequest计算待下载的文件大小

C#利用webrequest计算待下载的文件大小
string URL = textBox1.Text;
string filetype = URL.Substring(URL.LastIndexOf(".") + 1, (URL.Length - URL.LastIndexOf(".") - 1));
filetypevalue.Text = filetype.ToUpper();
string filename = URL.Substring(URL.LastIn ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号