Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jan 2014
    Posts
    164

    Conversion of List<IFilter> to IFilter !

    I need to add a filter recipe to a List<IFilter>, is it possible?

    I have a list of IFilters, when user selects a filter I'll add that to a List<IFilter> so I need to do same with filter recipe.
    Clipr: Best ever image clipping tool and first of it's kind in windows phone!!

    Download here
    http://www.windowsphone.com/s?appid=d533f018-238a-429c-affc-55a46c2dc69f

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,807

    Re: Conversion of List<IFilter> to IFilter !

    List, http://msdn.microsoft.com/en-us/libr...v=vs.110).aspx, stores a list of items of a single type. Adding a new item happens with its Add method. As your List<IFilter> happens to store IFilter elements, adding an other IFilter should not raise any compiler or run-time problems.

  3. #3
    Regular Contributor
    Join Date
    Jan 2014
    Posts
    164

    Re: Conversion of List<IFilter> to IFilter !

    Thank you for the reply,

    Here is my case,
    Code:
        public abstract class FilterModel
        {
            [XmlIgnore]
            public string Name { get; set; }
    
            [XmlIgnore]
            abstract public Queue<IFilter> Components { get; }
        }
    
        public class Effect_1FilterModel : FilterModel
        {
            public Effect_1FilterModel()
            {
                Name = "Effect_1";
            }
    
            [XmlIgnore]
            public override Queue<IFilter> Components
            {
                get
                {
                    var filters = new List<IFilter>();
    
    
                    filters.Add(new VignettingFilter(1.5, black));
                    //Adjust colors
                    Curve curve_colouradjust3 = new Curve(CurveInterpolation.Linear);
                    curve_colouradjust3.SetPoint(255, 229);
                    filters.Add(new CurvesFilter(curve_colouradjust2, curve_colouradjust2, curve_colouradjust2));
    
                    Queue<IFilter> components = new Queue<IFilter>();
                    
                    //How to add filters below?
                    components.Enqueue(filters);
                        
    
                    return components;
                }
            }
        }
    Clipr: Best ever image clipping tool and first of it's kind in windows phone!!

    Download here
    http://www.windowsphone.com/s?appid=d533f018-238a-429c-affc-55a46c2dc69f

Similar Threads

  1. How to convert CustomEffectBase to IFilter?
    By venu238 in forum Windows Phone Imaging
    Replies: 6
    Last Post: 2014-05-31, 12:08
  2. lwuit list +sub list its need to show sub list
    By babu7575 in forum Mobile Java General
    Replies: 0
    Last Post: 2011-04-04, 14:12
  3. Replies: 15
    Last Post: 2009-01-19, 18:32
  4. Audio conversion problems: Conversion between MP3 and SBC format
    By EZMCU in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2006-05-26, 10:43
  5. Replies: 0
    Last Post: 2006-05-25, 08:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×