/// <summary> /// 查找当前类型的图片 /// </summary> /// <param name="byData">当前打开文件的字节数据</param> /// <param name="file">当前文件</param> /// <param name="imgInfos">查找到的图片的信息</param> /// <returns>是否查找成功</returns> public override List <byte[]> SearchImg(byte[] byData, string file, List <string> imgInfos) { // 解压Adt文件 System.Diagnostics.Process exep = new System.Diagnostics.Process(); exep.StartInfo.FileName = @".\AdtDec.exe"; exep.StartInfo.CreateNoWindow = true; exep.StartInfo.UseShellExecute = false; string timFile = file.ToLower().Replace(".adt", ".tim"); if (File.Exists(timFile)) { File.Delete(timFile); } exep.StartInfo.Arguments = file + " " + timFile; exep.Start(); exep.WaitForExit(); int loopCount = 0; while (!File.Exists(timFile) && loopCount < 7) { Thread.Sleep(500); loopCount++; } if (!File.Exists(timFile)) { return(null); } ImgEditorTim timEditor = new ImgEditorTim(timFile); return(timEditor.SearchImg(File.ReadAllBytes(timFile), timFile, imgInfos)); }
/// <summary> /// 导入图片 /// </summary> public override byte[] ImportImg(string fileName, Image oldImg, byte[] byOldImg, string fileInfo) { ImgEditorTim timEditor = new ImgEditorTim(fileInfo); return(timEditor.ImportImg(fileName, oldImg, byOldImg, fileInfo)); }
/// <summary> /// 从图片数据中获取图片 /// </summary> /// <param name="byData"></param> /// <returns></returns> public override Image[] ImageDecode(byte[] byData, string fileInfo) { ImgEditorTim timEditor = new ImgEditorTim(fileInfo); return(timEditor.ImageDecode(byData, fileInfo)); }