public void UpdateCacheIfEmpty() { if (CacheManager.GetBitmapForFilterState() == null) { CacheManager.SetBitmapForFilterState( FilterManager.RecreateFilterStateFromState( CacheManager.GetOriginalImage(), CacheManager.filterState ) ); } }
private void addToolStripMenuItem_Click(object sender, EventArgs e) { string name = "Custom Kernel " + ++customKernelCounter; ToolStripMenuItem ts = new ToolStripMenuItem(name); ToolStripMenuItem tsEdit = new ToolStripMenuItem("Edit"); tsEdit.Click += OpenKernelEditor; ts.CheckOnClick = true; ts.CheckedChanged += StateChange; ts.DropDownItems.Add(tsEdit); Kernel.customKernels.Add(name, new CustomKernel(new double[3, 3] { { 0, 0, 0 }, { 0, 1, 0 }, { 0, 0, 0 } }, 1, 0, Point.Empty)); FilterManager.UpdateFilterMapping(name); filtersToolStripMenuItem.DropDownItems.Add(ts); }