//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(); }
/// <summary> /// Obtém informações instantâneas do gesto sendo executado pelo usuário. /// </summary> /// <param name="User">Usuário de quem o gesto é extraído.</param> public void Capture(User user) { if (user != null) { Feature feature = extractor.Extract(user); if (feature != null) { feature = filter.ApplyFilter(feature); } if (feature != null) { observations.Add(feature); } } }
public string TakePhoto() { string image = "原始圖片 包含人臉"; foreach (var plugin in plugins) { if (plugin != null && plugin is IFilter && plugin.Enabled) { IFilter filter = plugin as IFilter; image = filter.ApplyFilter(image); } } return(image); }
public static IQueryable <T> FilterBy <T>(this IQueryable <T> queryable, IFilter <T> filter) { return(filter.ApplyFilter(queryable)); }
public void SavePhoto(string imagePath) { _compressor.Compress(imagePath); _filter.ApplyFilter(imagePath); // save photo }
public void Store(string fileName, ICompressor compressor, IFilter filter) { compressor.Compress(fileName); filter.ApplyFilter(fileName); }
/// <summary> /// Method that can be used to filter objects in an <c>CollectionView</c>. /// </summary> /// <param name="o"> /// Object that will be checked with the filter criteria. /// </param> /// <returns> /// True, if the object should be displayed, else false. /// </returns> public bool FilterMethod(object o) { return(filter.ApplyFilter(o)); }
private void comboBoxOption_SelectedIndexChanged(object sender, EventArgs e) { filter.ApplyFilter((Filter)comboBoxOption.SelectedValue); pictureBoxImage.Image = filter.FilteredImage; }
public void Store() { _compressor.Compress(); _filter.ApplyFilter(); }