//Method to apply the filter private void ApplyFilter() { if (previewBitmap == null || cmbEdge.SelectedIndex == -1) { return; } this.pictureManipulation = new Filter(); switch (cmbFilters.SelectedItem.ToString()) { case "Black and white": filterResult = pictureManipulation.BlackWhite(originalBitmap); break; case "Night Filter": filterResult = pictureManipulation.ApplyFilter(originalBitmap, 1, 1, 1, 25); break; //The default is "None" because there is not risk that one day we remove the "none" default: //When the user click on "none" we come back to the original picture filterResult = originalBitmap; break; } //Call the method to apply the edge ApplyEdge(); }