예제 #1
0
        private IMagickImage ExecuteFlatten(XmlElement element, IMagickImageCollection collection)
        {
            Hashtable arguments = new Hashtable();

            foreach (XmlAttribute attribute in element.Attributes)
            {
                arguments[attribute.Name] = GetValue <MagickColor>(attribute);
            }
            if (arguments.Count == 0)
            {
                return(collection.Flatten());
            }
            else if (OnlyContains(arguments, "backgroundColor"))
            {
                return(collection.Flatten((MagickColor)arguments["backgroundColor"]));
            }
            else
            {
                throw new ArgumentException("Invalid argument combination for 'flatten', allowed combinations are: [] [backgroundColor]");
            }
        }
예제 #2
0
 private static IMagickImage ExecuteFlatten(IMagickImageCollection collection)
 {
     return(collection.Flatten());
 }