当前位置: 首页>>代码示例>>C#>>正文


C# MagickImage.LiquidRescale方法代码示例

本文整理汇总了C#中ImageMagick.MagickImage.LiquidRescale方法的典型用法代码示例。如果您正苦于以下问题:C# MagickImage.LiquidRescale方法的具体用法?C# MagickImage.LiquidRescale怎么用?C# MagickImage.LiquidRescale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageMagick.MagickImage的用法示例。


在下文中一共展示了MagickImage.LiquidRescale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecuteLiquidRescale

 private void ExecuteLiquidRescale(XmlElement element, MagickImage image)
 {
   MagickGeometry geometry_ = Variables.GetValue<MagickGeometry>(element, "geometry");
   image.LiquidRescale(geometry_);
 }
开发者ID:levesque,项目名称:Magick.NET,代码行数:5,代码来源:MagickImage.cs

示例2: ExecuteLiquidRescale

 private void ExecuteLiquidRescale(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.LiquidRescale((MagickGeometry)arguments["geometry"]);
   else if (OnlyContains(arguments, "percentage"))
     image.LiquidRescale((Percentage)arguments["percentage"]);
   else if (OnlyContains(arguments, "percentageWidth", "percentageHeight"))
     image.LiquidRescale((Percentage)arguments["percentageWidth"], (Percentage)arguments["percentageHeight"]);
   else if (OnlyContains(arguments, "width", "height"))
     image.LiquidRescale((Int32)arguments["width"], (Int32)arguments["height"]);
   else
     throw new ArgumentException("Invalid argument combination for 'liquidRescale', allowed combinations are: [geometry] [percentage] [percentageWidth, percentageHeight] [width, height]");
 }
开发者ID:dlemstra,项目名称:Magick.NET,代码行数:29,代码来源:MagickImage.cs

示例3: Test_LiquidRescale

    public void Test_LiquidRescale()
    {
      using (MagickImage image = new MagickImage(Files.MagickNETIconPNG))
      {
        MagickGeometry geometry = new MagickGeometry(128, 64);
        geometry.IgnoreAspectRatio = true;

        image.LiquidRescale(geometry);
        Assert.AreEqual(128, image.Width);
        Assert.AreEqual(64, image.Height);
      }
    }
开发者ID:marinehero,项目名称:Magick.NET,代码行数:12,代码来源:MagickImageTests.cs


注:本文中的ImageMagick.MagickImage.LiquidRescale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。