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


C# MagickImage.RotationalBlur方法代码示例

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


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

示例1: Execute

 public string Execute(FileItem item, string infile, string dest, ValuePairEnumerator configData)
 {
     var conf = new EffectViewModel(configData);
     dest = Path.Combine(Path.GetDirectoryName(dest), Path.GetFileNameWithoutExtension(dest) + ".jpg");
     using (MagickImage image = new MagickImage(infile))
     {
         switch (conf.SelectedMode)
         {
             case 0:
                 image.SepiaTone(new Percentage(conf.Param1));
                 break;
             case 1:
                 image.OilPaint(conf.Param1,0.1);
                 break;
             case 2:
                 image.Sketch();
                 break;
             case 3:
                 image.Charcoal();
                 break;
             case 4:
                 image.Solarize();
                 break;
             case 5:
                 image.Swirl(conf.Param1);
                 break;
             case 6:
                 image.Wave(PixelInterpolateMethod.Bilinear, conf.Param1, conf.Param2);
                 break;
             case 7:
                 image.BlueShift();
                 break;
             case 8:
                 image.RotationalBlur(conf.Param1);
                 break;
             case 9:
                 image.Raise(conf.Param1);
                 break;
             case 10:
                 image.Negate();
                 break;
             case 11:
                 image.ColorSpace = ColorSpace.Gray;
                 break;
         }
         image.Format = MagickFormat.Jpeg;
         image.Write(dest);
     }
     return dest;
 }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:50,代码来源:Effect.cs

示例2: ExecuteRotationalBlur

 private void ExecuteRotationalBlur(XmlElement element, MagickImage image)
 {
   Hashtable arguments = new Hashtable();
   foreach (XmlAttribute attribute in element.Attributes)
   {
     if (attribute.Name == "angle")
       arguments["angle"] = Variables.GetValue<double>(attribute);
     else if (attribute.Name == "channels")
       arguments["channels"] = Variables.GetValue<Channels>(attribute);
   }
   if (OnlyContains(arguments, "angle"))
     image.RotationalBlur((double)arguments["angle"]);
   else if (OnlyContains(arguments, "angle", "channels"))
     image.RotationalBlur((double)arguments["angle"], (Channels)arguments["channels"]);
   else
     throw new ArgumentException("Invalid argument combination for 'rotationalBlur', allowed combinations are: [angle] [angle, channels]");
 }
开发者ID:dlemstra,项目名称:Magick.NET,代码行数:17,代码来源:MagickImage.cs

示例3: Test_RotationalBlur

    public void Test_RotationalBlur()
    {
      using (MagickImage image = new MagickImage(Files.TestPNG))
      {
        image.RotationalBlur(20);

#if Q8
        ColorAssert.AreEqual(new MagickColor("#fbfbfb2b"), image, 10, 10);
        ColorAssert.AreEqual(new MagickColor("#8b0303"), image, 13, 67);
        ColorAssert.AreEqual(new MagickColor(OpenCLValue.Get("#167516", "#167616")), image, 63, 67);
        ColorAssert.AreEqual(new MagickColor("#3131fc"), image, 125, 67);
#elif Q16 || Q16HDRI
        ColorAssert.AreEqual(new MagickColor("#fbf7fbf7fbf72aab"), image, 10, 10);
        ColorAssert.AreEqual(new MagickColor("#8b2102990299"), image, 13, 67);
        ColorAssert.AreEqual(new MagickColor("#159275F21592"), image, 63, 67);
        ColorAssert.AreEqual(new MagickColor("#31853185fd47"), image, 125, 67);
#else
#error Not implemented!
#endif
      }

      using (MagickImage image = new MagickImage(Files.TestPNG))
      {
        image.RotationalBlur(20, Channels.RGB);

#if Q8
        ColorAssert.AreEqual(new MagickColor("#fbfbfb80"), image, 10, 10);
        ColorAssert.AreEqual(new MagickColor("#8b0303"), image, 13, 67);
        ColorAssert.AreEqual(new MagickColor(OpenCLValue.Get("#167516", "#167616")), image, 63, 67);
        ColorAssert.AreEqual(new MagickColor("#3131fc"), image, 125, 67);
#elif Q16 || Q16HDRI
        ColorAssert.AreEqual(new MagickColor("#fbf7fbf7fbf78000"), image, 10, 10);
        ColorAssert.AreEqual(new MagickColor("#8b2102990299"), image, 13, 67);
        ColorAssert.AreEqual(new MagickColor("#159275f21592"), image, 63, 67);
        ColorAssert.AreEqual(new MagickColor("#31853185fd47"), image, 125, 67);
#else
#error Not implemented!
#endif
      }
    }
开发者ID:dlemstra,项目名称:Magick.NET,代码行数:40,代码来源:MagickImageTests.cs


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