GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / TiffAddToMultiPageFile Method / TiffAddToMultiPageFile(Int32,Int32) Method
A unique image identifier of the GdPicture image representing the resulting multipage TIFF image file, that has been previously initialized using one of the TiffSaveAsMultiPageFile() methods. It is the first image resource of the resulting multipage TIFF image file.

Please follow the attached example on how to properly use the method.

A unique image identifier of the GdPicture image representing the image, which will be added to the resulting multipage TIFF image file. You can release this image resource using the GdPictureImaging.ReleaseGdPictureImage method after adding it to the resulting file.
Example





In This Topic
TiffAddToMultiPageFile(Int32,Int32) Method
In This Topic
Adds a required GdPicture image, which represents a single image, to a specified GdPicture image, which represents the multipage TIFF image file previously initialized by one of the TiffSaveAsMultiPageFile() methods. Both GdPicture images are defined by their unique image identifiers.

This method implements a sequential multipage TIFF writing approach, which is the faster way to create multipage TIFF image files by adding individual pages.

Syntax
'Declaration
 
Public Overloads Function TiffAddToMultiPageFile( _
   ByVal TiffImageID As Integer, _
   ByVal ImageID As Integer _
) As GdPictureStatus
public GdPictureStatus TiffAddToMultiPageFile( 
   int TiffImageID,
   int ImageID
)
public function TiffAddToMultiPageFile( 
    TiffImageID: Integer;
    ImageID: Integer
): GdPictureStatus; 
public function TiffAddToMultiPageFile( 
   TiffImageID : int,
   ImageID : int
) : GdPictureStatus;
public: GdPictureStatus TiffAddToMultiPageFile( 
   int TiffImageID,
   int ImageID
) 
public:
GdPictureStatus TiffAddToMultiPageFile( 
   int TiffImageID,
   int ImageID
) 

Parameters

TiffImageID
A unique image identifier of the GdPicture image representing the resulting multipage TIFF image file, that has been previously initialized using one of the TiffSaveAsMultiPageFile() methods. It is the first image resource of the resulting multipage TIFF image file.

Please follow the attached example on how to properly use the method.

ImageID
A unique image identifier of the GdPicture image representing the image, which will be added to the resulting multipage TIFF image file. You can release this image resource using the GdPictureImaging.ReleaseGdPictureImage method after adding it to the resulting file.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
Remarks
Please note that you need to close the resulting file using the GdPictureImaging.TiffCloseMultiPageFile method when you finish adding pages.
Example
Generating a multipage tiff from different image files.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    /*Adding first page from a jpeg file*/
    int tiffImageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg");
 
    // After calling TiffSaveAsMultiPageFile, tiffID will specify the multipage tiff identifier.
    gdpictureImaging.TiffSaveAsMultiPageFile(tiffImageID, "multipage.tif", TiffCompression.TiffCompressionAUTO);
 
    /*Adding second page from a png file*/
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.png");
    gdpictureImaging.TiffAddToMultiPageFile(tiffImageID, imageID);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
 
    /*Adding third page from a single page tiff file*/
    imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.tif");
    gdpictureImaging.TiffAddToMultiPageFile(tiffImageID, imageID);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
 
    /*Closing the produced multipage file*/
    gdpictureImaging.TiffCloseMultiPageFile(tiffImageID);
}
Applying the fire effect and negative effect to two duplicates of the same image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // Create two duplicate gdpicture images from the input file.
    int imageID1 = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg", false);
    int imageID2 = gdpictureImaging.CreateClonedGdPictureImage(imageID1);
 
    // Process both of your images (differently).
    gdpictureImaging.FxFire(imageID1);
    gdpictureImaging.FxNegative(imageID2);
 
    // Save your images in the same multipage tif file.
    gdpictureImaging.TiffSaveAsMultiPageFile(imageID1, "images.tif", TiffCompression.TiffCompressionAUTO);
    gdpictureImaging.TiffAddToMultiPageFile(imageID1, imageID2);
    gdpictureImaging.TiffCloseMultiPageFile(imageID1);
    gdpictureImaging.ReleaseGdPictureImage(imageID1);
    gdpictureImaging.ReleaseGdPictureImage(imageID2);
}
See Also