本文整理汇总了C#中ImageMagick.MagickImageCollection.Combine方法的典型用法代码示例。如果您正苦于以下问题:C# MagickImageCollection.Combine方法的具体用法?C# MagickImageCollection.Combine怎么用?C# MagickImageCollection.Combine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageMagick.MagickImageCollection
的用法示例。
在下文中一共展示了MagickImageCollection.Combine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_Combine
public void Test_Combine()
{
using (MagickImage rose = new MagickImage(Files.Builtin.Rose))
{
using (MagickImageCollection collection = new MagickImageCollection(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);
}
}
}
示例2: 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);
}
}
}
示例3: ExecuteCombine
private MagickImage ExecuteCombine(XmlElement element, MagickImageCollection collection)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
arguments[attribute.Name] = Variables.GetValue<Channels>(attribute);
}
if (arguments.Count == 0)
return collection.Combine();
else if (OnlyContains(arguments, "channels"))
return collection.Combine((Channels)arguments["channels"]);
else
throw new ArgumentException("Invalid argument combination for 'combine', allowed combinations are: [] [channels]");
}