private void ExecuteDrawableComposite(XmlElement element, Collection<IDrawable> drawables)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "compose")
arguments["compose"] = Variables.GetValue<CompositeOperator>(attribute);
else if (attribute.Name == "offset")
arguments["offset"] = Variables.GetValue<MagickGeometry>(attribute);
else if (attribute.Name == "x")
arguments["x"] = Variables.GetValue<double>(attribute);
else if (attribute.Name == "y")
arguments["y"] = Variables.GetValue<double>(attribute);
}
foreach (XmlElement elem in element.SelectNodes("*"))
{
arguments[elem.Name] = CreateMagickImage(elem);
}
if (OnlyContains(arguments, "offset", "compose", "image"))
drawables.Add(new DrawableComposite((MagickGeometry)arguments["offset"], (CompositeOperator)arguments["compose"], (MagickImage)arguments["image"]));
else if (OnlyContains(arguments, "offset", "image"))
drawables.Add(new DrawableComposite((MagickGeometry)arguments["offset"], (MagickImage)arguments["image"]));
else if (OnlyContains(arguments, "x", "y", "compose", "image"))
drawables.Add(new DrawableComposite((double)arguments["x"], (double)arguments["y"], (CompositeOperator)arguments["compose"], (MagickImage)arguments["image"]));
else if (OnlyContains(arguments, "x", "y", "image"))
drawables.Add(new DrawableComposite((double)arguments["x"], (double)arguments["y"], (MagickImage)arguments["image"]));
else
throw new ArgumentException("Invalid argument combination for 'composite', allowed combinations are: [offset, compose, image] [offset, image] [x, y, compose, image] [x, y, image]");
}
private void ExecuteDrawableDensity(XmlElement element, Collection<IDrawable> drawables)