private void SaveImage(HTuple handle, bool result) { try { Task.Run(() => { string imageName = $"{DateTime.Now:HHmmss}.tiff"; string res = result ? "OK" : "NG"; string pathSource = $@"{ProductMgr.GetInstance().ProductPath}Images\{DateTime.Now:yyyyMMdd}\{res}\Robot\Source\"; string pathWindow = $@"{ProductMgr.GetInstance().ProductPath}Images\{DateTime.Now:yyyyMMdd}\{res}\Robot\Window\"; if (!System.IO.Directory.Exists(pathSource)) { System.IO.Directory.CreateDirectory(pathSource); } if (!System.IO.Directory.Exists(pathWindow)) { System.IO.Directory.CreateDirectory(pathWindow); } string fileNameSource = $"{pathSource}{imageName}"; string fileNameWindow = $"{pathWindow}{imageName}"; HDevelopExport.WriteImage(imgSrc, fileNameSource); HDevelopExport.DumpWindow(handle, fileNameWindow); }); } catch (Exception) { } }