本文整理汇总了C#中ImageMagick.MagickImageCollection.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# MagickImageCollection.AddRange方法的具体用法?C# MagickImageCollection.AddRange怎么用?C# MagickImageCollection.AddRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageMagick.MagickImageCollection
的用法示例。
在下文中一共展示了MagickImageCollection.AddRange方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_AddRange
public void Test_AddRange()
{
using (MagickImageCollection collection = new MagickImageCollection(Files.RoseSparkleGIF))
{
Assert.AreEqual(3, collection.Count);
collection.AddRange(Files.RoseSparkleGIF);
Assert.AreEqual(6, collection.Count);
collection.AddRange(collection);
Assert.AreEqual(12, collection.Count);
List<MagickImage> images = new List<MagickImage>();
images.Add(new MagickImage("xc:red", 100, 100));
collection.AddRange(images);
Assert.AreEqual(13, collection.Count);
}
}
示例2: Test_Smush
public void Test_Smush()
{
using (MagickImageCollection collection = new MagickImageCollection())
{
ExceptionAssert.Throws<InvalidOperationException>(delegate ()
{
collection.SmushHorizontal(5);
});
ExceptionAssert.Throws<InvalidOperationException>(delegate ()
{
collection.SmushVertical(6);
});
collection.AddRange(Files.RoseSparkleGIF);
using (MagickImage image = collection.SmushHorizontal(20))
{
Assert.AreEqual((70 * 3) + (20 * 2), image.Width);
Assert.AreEqual(46, image.Height);
}
using (MagickImage image = collection.SmushVertical(40))
{
Assert.AreEqual(70, image.Width);
Assert.AreEqual((46 * 3) + (40 * 2), image.Height);
}
}
}
示例3: Test_Morph
public void Test_Morph()
{
using (MagickImageCollection collection = new MagickImageCollection())
{
ExceptionAssert.Throws<InvalidOperationException>(delegate ()
{
collection.Morph(10);
});
collection.Add(Files.Builtin.Logo);
ExceptionAssert.Throws<InvalidOperationException>(delegate ()
{
collection.Morph(10);
});
collection.AddRange(Files.Builtin.Wizard);
collection.Morph(4);
Assert.AreEqual(6, collection.Count);
}
}
示例4: Test_Combine
public void Test_Combine()
{
using (MagickImage rose = new MagickImage(Files.Builtin.Rose))
{
using (MagickImageCollection collection = new MagickImageCollection())
{
ExceptionAssert.Throws<InvalidOperationException>(delegate ()
{
collection.Combine();
});
collection.AddRange(rose.Separate(Channels.RGB));
Assert.AreEqual(3, collection.Count);
MagickImage image = collection.Merge();
Assert.AreNotEqual(rose.TotalColors, image.TotalColors);
image.Dispose();
image = collection.Combine();
Assert.AreEqual(rose.TotalColors, image.TotalColors);
}
}
}