private void Filter(object sender, EventArgs e) { var options = Resources.PhotoFilters; using var filterDialog = new InputDropdownDialog <IMatrixFilter>( "Photo Filter", "The filter to be applied to the image:", options); if (filterDialog.ShowDialog() == DialogResult.OK) { var filter = filterDialog.Result; _state.Filter(filter); _lastCommand = new Action(() => _state.Filter(filter)); } RefreshImageState(); }
private void Flip(object sender, EventArgs e) { var options = Resources.FlipValues; using var flipDialog = new InputDropdownDialog <string>( "Flip", "Which direction would you like to flip the image?", options); if (flipDialog.ShowDialog() == DialogResult.OK) { var verticalFlip = flipDialog.Result .ToLower() .Equals("vertical"); _state.Flip(verticalFlip); _lastCommand = new Action(() => _state.Flip(verticalFlip)); } RefreshImageState(); }
private void DetectEdges(object sender, EventArgs e) { var options = Resources.EdgeFilters; using var edgesDialog = new InputDropdownDialog <IEdgeFilter>( "Detect Edges", "The algorithm to detect edges with:", options, true); if (edgesDialog.ShowDialog() == DialogResult.OK) { var filter = edgesDialog.Result; var greyscale = edgesDialog.CheckboxResult; _state.DetectEdges(filter, greyscale); _lastCommand = new Action(() => _state.DetectEdges(filter, greyscale)); } RefreshImageState(); }