ImageMagick.MagickScript.ExecuteScale C# (CSharp) Method

ExecuteScale() private method

private ExecuteScale ( XmlElement element, MagickImage image ) : void
element XmlElement
image MagickImage
return void
    private void ExecuteScale(XmlElement element, MagickImage image)
    {
      Hashtable arguments = new Hashtable();
      foreach (XmlAttribute attribute in element.Attributes)
      {
        if (attribute.Name == "geometry")
          arguments["geometry"] = Variables.GetValue<MagickGeometry>(attribute);
        else if (attribute.Name == "height")
          arguments["height"] = Variables.GetValue<Int32>(attribute);
        else if (attribute.Name == "percentage")
          arguments["percentage"] = Variables.GetValue<Percentage>(attribute);
        else if (attribute.Name == "percentageHeight")
          arguments["percentageHeight"] = Variables.GetValue<Percentage>(attribute);
        else if (attribute.Name == "percentageWidth")
          arguments["percentageWidth"] = Variables.GetValue<Percentage>(attribute);
        else if (attribute.Name == "width")
          arguments["width"] = Variables.GetValue<Int32>(attribute);
      }
      if (OnlyContains(arguments, "geometry"))
        image.Scale((MagickGeometry)arguments["geometry"]);
      else if (OnlyContains(arguments, "percentage"))
        image.Scale((Percentage)arguments["percentage"]);
      else if (OnlyContains(arguments, "percentageWidth", "percentageHeight"))
        image.Scale((Percentage)arguments["percentageWidth"], (Percentage)arguments["percentageHeight"]);
      else if (OnlyContains(arguments, "width", "height"))
        image.Scale((Int32)arguments["width"], (Int32)arguments["height"]);
      else
        throw new ArgumentException("Invalid argument combination for 'scale', allowed combinations are: [geometry] [percentage] [percentageWidth, percentageHeight] [width, height]");
    }
    private void ExecuteSegment(XmlElement element, MagickImage image)
MagickScript