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()); } } }); }
void EvtTransfullEpiImg(Tuple <ImgIdxPos, Image <Gray, byte> >[] zippedlist) { this.Dispatcher.Invoke(( Action )(() => zippedlist.ActLoop(ths => EpiDisplayOrigImg(ths.Item1, ths.Item2)))); }