private void ExecuteInverseFloodFill(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "alpha")
arguments["alpha"] = Variables.GetValue<QuantumType>(attribute);
else if (attribute.Name == "color")
arguments["color"] = Variables.GetValue<MagickColor>(attribute);
else if (attribute.Name == "coordinate")
arguments["coordinate"] = Variables.GetValue<PointD>(attribute);
else if (attribute.Name == "target")
arguments["target"] = Variables.GetValue<MagickColor>(attribute);
else if (attribute.Name == "x")
arguments["x"] = Variables.GetValue<Int32>(attribute);
else if (attribute.Name == "y")
arguments["y"] = Variables.GetValue<Int32>(attribute);
}
foreach (XmlElement elem in element.SelectNodes("*"))
{
arguments[elem.Name] = CreateMagickImage(elem);
}
if (OnlyContains(arguments, "alpha", "x", "y"))
image.InverseFloodFill((QuantumType)arguments["alpha"], (Int32)arguments["x"], (Int32)arguments["y"]);
else if (OnlyContains(arguments, "color", "coordinate"))
image.InverseFloodFill((MagickColor)arguments["color"], (PointD)arguments["coordinate"]);
else if (OnlyContains(arguments, "color", "coordinate", "target"))
image.InverseFloodFill((MagickColor)arguments["color"], (PointD)arguments["coordinate"], (MagickColor)arguments["target"]);
else if (OnlyContains(arguments, "color", "x", "y"))
image.InverseFloodFill((MagickColor)arguments["color"], (Int32)arguments["x"], (Int32)arguments["y"]);
else if (OnlyContains(arguments, "color", "x", "y", "target"))
image.InverseFloodFill((MagickColor)arguments["color"], (Int32)arguments["x"], (Int32)arguments["y"], (MagickColor)arguments["target"]);
else if (OnlyContains(arguments, "image", "coordinate"))
image.InverseFloodFill((MagickImage)arguments["image"], (PointD)arguments["coordinate"]);
else if (OnlyContains(arguments, "image", "coordinate", "target"))
image.InverseFloodFill((MagickImage)arguments["image"], (PointD)arguments["coordinate"], (MagickColor)arguments["target"]);
else if (OnlyContains(arguments, "image", "x", "y"))
image.InverseFloodFill((MagickImage)arguments["image"], (Int32)arguments["x"], (Int32)arguments["y"]);
else if (OnlyContains(arguments, "image", "x", "y", "target"))
image.InverseFloodFill((MagickImage)arguments["image"], (Int32)arguments["x"], (Int32)arguments["y"], (MagickColor)arguments["target"]);
else
throw new ArgumentException("Invalid argument combination for 'inverseFloodFill', allowed combinations are: [alpha, x, y] [color, coordinate] [color, coordinate, target] [color, x, y] [color, x, y, target] [image, coordinate] [image, coordinate, target] [image, x, y] [image, x, y, target]");
}
private void ExecuteInverseLevel(XmlElement element, MagickImage image)