public void SetImageList() { new FolderBrowserDialog() .Act(ths => ths.RootFolder = Environment.SpecialFolder.MyComputer) // for test .Act(ths => ths.SelectedPath = @"D:\03JobPro\2017\05_veeco\Mapping Data\5um Data 0602\VP_538\Resized") // for test .Act(ofd => { if (ofd.ShowDialog() == DialogResult.OK) { string[] imgpathslist = Directory.GetFiles(ofd.SelectedPath, "*.bmp"); var imgpaths = imgpathslist .Select(Path.GetFileName) .ToArray(); if (imgpaths.GetLength(0) != 6) { MessageBox.Show("Please check files or folder"); SetImageList(); } else { imgpathslist.ActLoop(path => EpiColorImgDic.Add(path.TrimFileNameOnly() .Map2ImgPos() , new Image <Bgr, byte>(path))); evtTrsFullImg( imgpathslist.Map2ImgZipedPos() .ActLoop(pair => EpiGrayImgDic.Add(pair.Item1, pair.Item2)) .ToArray()); } } }); }
public void SetImage(Nullable <int> row, Nullable <int> col, string path) { var pos = Pos2EnumTable[Tuple.Create(row, col)]; var testimg = new Image <Bgr, byte>(path); EpiColorImgDic.Add(pos , new Image <Bgr, byte>(path)); new Image <Gray, byte>(path) .Act(img => EpiGrayImgDic.Add( pos , img)) .Act(img => evtDroppedImg( pos , img)); }