输入图像 /// 文件名 private void SaveImage(ICogImage cogImage, _康耐视智能相机 visionpro 写入excel">
赞
踩
简单的文件操作,包括读写
/// <summary> /// vpro写图片到本地 /// </summary> /// <param name="cogImage">输入图像</param> /// <param name="fileName">文件名</param> private void SaveImage(ICogImage cogImage, string fileName) { if (null == cogImage) return; using (CogImageFileTool tool = new CogImageFileTool()) { tool.InputImage = cogImage; tool.Operator.Open(fileName, CogImageFileModeConstants.Write); tool.Run(); } } /// <summary> /// vpro读取文件到内存 /// </summary> /// <param name="fileName">文件名(全路径)</param> /// <returns></returns> private ICogImage ReadImage(string fileName) { ICogImage tempImage = null; using (CogImageFileTool tool = new CogImageFileTool()) { tool.Operator.Open(fileName, CogImageFileModeConstants.Read); tool.Run(); tempImage = tool.OutputImage; } return tempImage; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。