private void FireSliceLoaded(DicomSliceLoadEventArgs e) { if (DicomSliceLoad != null) { DicomSliceLoad(this, e); } }
void watcher_SliceCreated(object sender, FileSystemEventArgs e) { System.Windows.Forms.Application.DoEvents(); bool loaded = false; while (!loaded) { try { string file = e.FullPath; FileStream fs = File.OpenRead(file); Bitmap b = new Bitmap(fs); Bitmap newB = Utility.Util.Copy(b); this._images.Add(newB); DicomSliceLoadEventArgs e2 = new DicomSliceLoadEventArgs(newB, idx, this.numberOfFrames); FireSliceLoaded(e2); b.Dispose(); fs.Close(); loaded = true; idx++; File.Delete(file); } catch (Exception) { } } }
void LoadSlices(string fileName) { System.Windows.Forms.Application.DoEvents(); try { string file = fileName; FileStream fs = File.OpenRead(file); Bitmap b = new Bitmap(fs); Bitmap newB = Utility.Util.Copy(b); this._images.Add(newB); DicomSliceLoadEventArgs e2 = new DicomSliceLoadEventArgs(newB, idx, this.numberOfFrames); FireSliceLoaded(e2); b.Dispose(); fs.Close(); idx++; File.Delete(file); } catch (Exception) { } }
void dcm_DicomSliceLoad(object sender, DicomSliceLoadEventArgs e) { this.FireSliceLoaded(e); System.Windows.Forms.Application.DoEvents(); //if (e.Idx == 0) //{ // LoadSliceHelper((Bitmap)e.Thumbnail.Clone()); //} }
private void FireSliceLoaded(DicomSliceLoadEventArgs e) { if (DicomSliceLoad != null) DicomSliceLoad(this, e); }