本文整理汇总了C#中ImageMagick.MagickImageCollection.Montage方法的典型用法代码示例。如果您正苦于以下问题:C# MagickImageCollection.Montage方法的具体用法?C# MagickImageCollection.Montage怎么用?C# MagickImageCollection.Montage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageMagick.MagickImageCollection
的用法示例。
在下文中一共展示了MagickImageCollection.Montage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateCollage
// Create single sized collage from image collection
byte[] GenerateCollage(MagickImageCollection collection, int size)
{
MontageMode mode = MontageMode.Concatenate;
MontageSettings settings = new MontageSettings(mode);
settings.BackgroundColor = new MagickColor("#FFF");
settings.Geometry = new MagickGeometry("1x1<");
using (MagickImage result = collection.Montage(settings))
{
result.Format = MagickFormat.Png;
result.Resize(new MagickGeometry(size));
return result.ToByteArray();
}
}
示例2: Test_Montage
public void Test_Montage()
{
using (MagickImageCollection images = new MagickImageCollection())
{
for (int i = 0; i < 9; i++)
images.Add(Files.Builtin.Logo);
MontageSettings ms = new MontageSettings();
ms.Geometry = new MagickGeometry(string.Format("{0}x{1}", 200, 200));
ms.TileGeometry = new MagickGeometry(string.Format("{0}x", 2));
using (MagickImage montageResult = images.Montage(ms))
{
Assert.IsNotNull(montageResult);
Assert.AreEqual(400, montageResult.Width);
Assert.AreEqual(1000, montageResult.Height);
}
}
}
示例3: Test_Montage
public void Test_Montage()
{
using (MagickImageCollection collection = new MagickImageCollection())
{
MontageSettings settings = new MontageSettings();
settings.Geometry = new MagickGeometry(string.Format("{0}x{1}", 200, 200));
settings.TileGeometry = new MagickGeometry(string.Format("{0}x", 2));
ExceptionAssert.Throws<InvalidOperationException>(delegate ()
{
collection.Montage(settings);
});
for (int i = 0; i < 9; i++)
collection.Add(Files.Builtin.Logo);
using (MagickImage montageResult = collection.Montage(settings))
{
Assert.IsNotNull(montageResult);
Assert.AreEqual(400, montageResult.Width);
Assert.AreEqual(1000, montageResult.Height);
}
}
}
示例4: ExecuteMontage
private MagickImage ExecuteMontage(XmlElement element, MagickImageCollection collection)
{
MontageSettings settings_ = CreateMontageSettings(element["settings"]);
return collection.Montage(settings_);
}