ImageMagick.MagickScript.ExecuteComposite C# (CSharp) Method

ExecuteComposite() private method

private ExecuteComposite ( XmlElement element, MagickImage image ) : void
element System.Xml.XmlElement
image MagickImage
return void
    private void ExecuteComposite(XmlElement element, MagickImage image)
    {
      Hashtable arguments = new Hashtable();
      foreach (XmlAttribute attribute in element.Attributes)
      {
        if (attribute.Name == "args")
          arguments["args"] = Variables.GetValue<String>(attribute);
        else if (attribute.Name == "compose")
          arguments["compose"] = Variables.GetValue<CompositeOperator>(attribute);
        else if (attribute.Name == "gravity")
          arguments["gravity"] = Variables.GetValue<Gravity>(attribute);
        else if (attribute.Name == "offset")
          arguments["offset"] = Variables.GetValue<PointD>(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, "image"))
        image.Composite((MagickImage)arguments["image"]);
      else if (OnlyContains(arguments, "image", "compose"))
        image.Composite((MagickImage)arguments["image"], (CompositeOperator)arguments["compose"]);
      else if (OnlyContains(arguments, "image", "compose", "args"))
        image.Composite((MagickImage)arguments["image"], (CompositeOperator)arguments["compose"], (String)arguments["args"]);
      else if (OnlyContains(arguments, "image", "gravity"))
        image.Composite((MagickImage)arguments["image"], (Gravity)arguments["gravity"]);
      else if (OnlyContains(arguments, "image", "gravity", "compose"))
        image.Composite((MagickImage)arguments["image"], (Gravity)arguments["gravity"], (CompositeOperator)arguments["compose"]);
      else if (OnlyContains(arguments, "image", "gravity", "compose", "args"))
        image.Composite((MagickImage)arguments["image"], (Gravity)arguments["gravity"], (CompositeOperator)arguments["compose"], (String)arguments["args"]);
      else if (OnlyContains(arguments, "image", "offset"))
        image.Composite((MagickImage)arguments["image"], (PointD)arguments["offset"]);
      else if (OnlyContains(arguments, "image", "offset", "compose"))
        image.Composite((MagickImage)arguments["image"], (PointD)arguments["offset"], (CompositeOperator)arguments["compose"]);
      else if (OnlyContains(arguments, "image", "offset", "compose", "args"))
        image.Composite((MagickImage)arguments["image"], (PointD)arguments["offset"], (CompositeOperator)arguments["compose"], (String)arguments["args"]);
      else if (OnlyContains(arguments, "image", "x", "y"))
        image.Composite((MagickImage)arguments["image"], (Int32)arguments["x"], (Int32)arguments["y"]);
      else if (OnlyContains(arguments, "image", "x", "y", "compose"))
        image.Composite((MagickImage)arguments["image"], (Int32)arguments["x"], (Int32)arguments["y"], (CompositeOperator)arguments["compose"]);
      else if (OnlyContains(arguments, "image", "x", "y", "compose", "args"))
        image.Composite((MagickImage)arguments["image"], (Int32)arguments["x"], (Int32)arguments["y"], (CompositeOperator)arguments["compose"], (String)arguments["args"]);
      else
        throw new ArgumentException("Invalid argument combination for 'composite', allowed combinations are: [image] [image, compose] [image, compose, args] [image, gravity] [image, gravity, compose] [image, gravity, compose, args] [image, offset] [image, offset, compose] [image, offset, compose, args] [image, x, y] [image, x, y, compose] [image, x, y, compose, args]");
    }
    private void ExecuteContrast(XmlElement element, MagickImage image)
MagickScript