コード例 #1
0
        //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();
        }
コード例 #2
0
ファイル: Observer.cs プロジェクト: togores/Vitruvius
 /// <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);
         }
     }
 }
コード例 #3
0
ファイル: Camera.cs プロジェクト: tommy7568/CSharp-Examples
        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);
        }
コード例 #4
0
 public static IQueryable <T> FilterBy <T>(this IQueryable <T> queryable, IFilter <T> filter)
 {
     return(filter.ApplyFilter(queryable));
 }
コード例 #5
0
 public void SavePhoto(string imagePath)
 {
     _compressor.Compress(imagePath);
     _filter.ApplyFilter(imagePath);
     // save photo
 }
コード例 #6
0
 public void Store(string fileName, ICompressor compressor, IFilter filter)
 {
     compressor.Compress(fileName);
     filter.ApplyFilter(fileName);
 }
コード例 #7
0
 /// <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));
 }
コード例 #8
0
 private void comboBoxOption_SelectedIndexChanged(object sender, EventArgs e)
 {
     filter.ApplyFilter((Filter)comboBoxOption.SelectedValue);
     pictureBoxImage.Image = filter.FilteredImage;
 }
コード例 #9
0
 public void Store()
 {
     _compressor.Compress();
     _filter.ApplyFilter();
 }