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]"); } }
private static IMagickImage ExecuteFlatten(IMagickImageCollection collection) { return(collection.Flatten()); }