本文整理汇总了C#中ImageMagick.MagickImage.Wave方法的典型用法代码示例。如果您正苦于以下问题:C# MagickImage.Wave方法的具体用法?C# MagickImage.Wave怎么用?C# MagickImage.Wave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageMagick.MagickImage
的用法示例。
在下文中一共展示了MagickImage.Wave方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_Dispose
public void Test_Dispose()
{
MagickImage image = new MagickImage(Color.Red, 10, 10);
MagickImageCollection collection = new MagickImageCollection();
collection.Add(image);
collection.Dispose();
Assert.AreEqual(0, collection.Count);
ExceptionAssert.Throws<ObjectDisposedException>(delegate ()
{
image.Wave();
});
}
示例2: 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;
}
示例3: ExecuteWave
private void ExecuteWave(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "amplitude")
arguments["amplitude"] = Variables.GetValue<double>(attribute);
else if (attribute.Name == "length")
arguments["length"] = Variables.GetValue<double>(attribute);
else if (attribute.Name == "method")
arguments["method"] = Variables.GetValue<PixelInterpolateMethod>(attribute);
}
if (arguments.Count == 0)
image.Wave();
else if (OnlyContains(arguments, "method", "amplitude", "length"))
image.Wave((PixelInterpolateMethod)arguments["method"], (double)arguments["amplitude"], (double)arguments["length"]);
else
throw new ArgumentException("Invalid argument combination for 'wave', allowed combinations are: [] [method, amplitude, length]");
}
示例4: Test_Wave
public void Test_Wave()
{
using (MagickImage image = new MagickImage(Files.TestPNG))
{
image.Wave();
using (MagickImage original = new MagickImage(Files.TestPNG))
{
#if Q8
Assert.AreEqual(0.63104, original.Compare(image, ErrorMetric.RootMeanSquared), 0.00001);
#elif Q16 || Q16HDRI
Assert.AreEqual(0.63109, original.Compare(image, ErrorMetric.RootMeanSquared), 0.00001);
#else
#error Not implemented!
#endif
}
}
}