2012年10月15日

用指针读BMP图像

摘要: 实践中经常用到,故写下备用。/// <summary> /// 将8bit的BMP图像读入数组文件 /// </summary> /// <param name="filePath">图像文件路径</param> /// <returns>图像像素数组</returns> private byte[,] ReadImage(string filePath) { Bitmap MyBitmap = (Bitmap)Bitmap.FromFile(filePath); BitmapData data = M 阅读全文

posted @ 2012-10-15 20:23 guyichang 阅读(342) 评论(0) 推荐(0) 编辑

读写Excel文档

摘要: 实践中经常用到,故写下备用1、引用COM,包括Microsoft Excel 12.0 Object Library与Microsoft Office 12.0 Object Library2、using Excel = Microsoft.Office.Interop.Excel;/// <summary> /// 根据Excel格坐标写Excel文件 /// </summary> private void WriteExcel() { Excel.Application oXL; Excel._Workbook oWB; Excel._Worksh... 阅读全文

posted @ 2012-10-15 20:20 guyichang 阅读(146) 评论(0) 推荐(0) 编辑

读写TXT文档

摘要: 实践中经常用到读写txt文件的时候,里面下面两个函数即可实现读写,filePath为txt文件的绝对路径/// <summary> /// 写txt文件 /// </summary> /// <param name="filePath">txt文件路径</param> private void WriteFile(string filePath) { StreamWriter write = new StreamWriter(filePath); string line = ""; write.WriteL 阅读全文

posted @ 2012-10-15 20:17 guyichang 阅读(171) 评论(0) 推荐(0) 编辑

导航