Imagise.Merger
24.9.0
See the version list below for details.
dotnet add package Imagise.Merger --version 24.9.0
NuGet\Install-Package Imagise.Merger -Version 24.9.0
<PackageReference Include="Imagise.Merger" Version="24.9.0" />
paket add Imagise.Merger --version 24.9.0
#r "nuget: Imagise.Merger, 24.9.0"
// Install Imagise.Merger as a Cake Addin #addin nuget:?package=Imagise.Merger&version=24.9.0 // Install Imagise.Merger as a Cake Tool #tool nuget:?package=Imagise.Merger&version=24.9.0
Imagise.Merger plugin for .NET
** The Imagise Image Merger plugin for .NET enables seamless merging of images either vertically or horizontally without compromising quality, encouraging creativity in designing unique photo collages. This flexible tool supports multiple file formats, allowing you to easily craft visually striking compositions.**
Platform Independence
Imagise.Merger plugin for .NET can be used to develop applications on Windows Desktop (x86, x64), Windows Server (x86, x64), Windows Azure, Windows Embedded (CE 6.0 R2), as well as Linux x64. The supported platforms include .Net6.0, .Net7.0, .Net8.0.
New Features & Enhancements in Version 24.9
Imagise.Merger is live.
Getting Started with Imagise.Merger plugin for .NET
Ready to try the Imagise.Merger plugin for .NET? You can easily add the Imagise.Merger NuGet package to your .NET application by running the following command in the Package Manager Console in Visual Studio:
Install-Package Imagise.Merger
If you already have Imagise.Merger installed and want to upgrade to the latest version, simply run:
Update-Package Imagise.Merger
This will ensure you have the most up-to-date version.
The following examples can assist you in applying merge within your application
Merge images vertically or horizonatlly
var images = new List<Image>();
int maxWidth = 0;
int maxHeight = 0;
int totalWidth = 0;
int totalHeight = 0;
foreach (var fileName in Directory.GetFiles(inputFolder))
{
var image = Image.Load(Path.Combine(inputFolder, fileName));
totalWidth += image.Width;
if (image.Width > maxWidth)
{
maxWidth = image.Width;
}
totalHeight += image.Height;
if (image.Height > maxHeight)
{
maxHeight = image.Height;
}
images.Add(image);
}
try
{
var outputPath = Path.Combine(outputFolder, "merge_horizontal.jpg");
MergeImages(images, MergeDirection.Horizontal, totalWidth, maxHeight, outputPath);
outputPath = Path.Combine(outputFolder, "merge_vertical.jpg");
MergeImages(images, MergeDirection.Vertical, totalHeight, maxWidth, outputPath);
}
finally
{
images.ForEach(image => image.Dispose());
}
static void MergeImages(List<Image> images, MergeDirection direction, int totalSize, int maxSize, string outputPath)
{
int targetWidth, targetHeight;
switch (direction)
{
case MergeDirection.Horizontal:
{
targetWidth = totalSize;
targetHeight = maxSize;
break;
}
case MergeDirection.Vertical:
{
targetWidth = maxSize;
targetHeight = totalSize;
break;
}
default:
throw new ArgumentException("Unexpected merge direction");
}
var pngOptions = new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha };
using (Stream stream = new MemoryStream())
{
pngOptions.Source = new StreamSource(stream);
using (var image = Imagise.Core.Creator.Image.Create(pngOptions, targetWidth, targetHeight))
{
var graphics = new Graphics(image);
graphics.Clear(Color.White);
float x = 0, y = 0;
images.ForEach(image =>
{
if (image.IsVectorImage)
{
graphics.PaintableImageOptions = new BmpOptions()
{
BitsPerPixel = 32,
VectorRasterizationOptions = ImagiseHelper.CreateVectorRasterizationOptions(image.FileFormat,
new Size(image.Width, image.Height))
};
}
graphics.DrawImage(image, new RectangleF(x, y, image.Width, image.Height));
if (direction == MergeDirection.Horizontal)
{
x += image.Width;
}
if (direction == MergeDirection.Vertical)
{
y += image.Height;
}
});
image.Save(outputPath);
}
}
}
enum MergeDirection
{
Horizontal = 0,
Vertical = 1
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Newtonsoft.Json (>= 13.0.1)
- System.Text.Encoding.CodePages (>= 7.0.0)
-
net8.0
- Newtonsoft.Json (>= 13.0.1)
- System.Text.Encoding.CodePages (>= 7.0.0)
GitHub repositories
This package is not used by any popular GitHub repositories.