This Technical tip explains how to concatenate multiple TIFF images using Aspose.Imaging for .NET. Sometimes you need to concatenate a TIFF Image into another TIFF image and Aspose.Imaging supports this feature of concatenating multiple Tiff images. This article exhibits the TIFF image concatenation feature of Aspose.Imaging for .Net API. We will use TiffImage and TiffFrame classes to concatenate multiple TIFF images. We can use both standard methods, from file and from stream, to concatenate TIFF images. First, we will create a copy of the destination image to avoid any alteration to original image. Source images could be concatenated directly to the original destination image; it’s depending upon the requirement. Then we will create instances of images and load images from local disk. Now we will copy the active frame of source image using CopyFrame method of TiffFrame class and add that copied frame in destination image with the help of AddFrame method of TIffImage class. Finally we will save image back to local disk.
'Create a copy of original image to avoid any alteration
File.Copy(MyDir&"sample.tif", MyDir&"Testconct.tif", True)
'Create an instance of TiffImage and load the copied destination image
Using image As TiffImage = CType(Aspose.Imaging.Image.Load(MyDir&"Testconct.tif"), TiffImage)
'Create an instance of TiffImage and load the source image
Using image1 As TiffImage = CType(Aspose.Imaging.Image.Load(MyDir&"sample1.tif"), TiffImage)
' Create an instance of TIffFrame and copy active frame of source image
Dim frame As TiffFrame = TiffFrame.CopyFrame(image1.ActiveFrame)
' Add copied frame to destination image
save the image with changes.
More about Aspose.Imaging for .NET
- Homepage of Aspose.Imaging for .NET: http://www.aspose.com/.net/imaging-component.aspx
- Download Aspose.Imaging for .NET: http://www.aspose.com/community/files/51/.net-components/aspose.imaging-for-.net/default.aspx