Hi Loic !
How we can split a TIF multipage file in various TIF singlepage files ?
Thank you in advance.
Paulo Moura
split TIF files
- paulo moura
- Posts: 4
- Joined: Thu Sep 06, 2007 9:12 pm
- Location: Brasil
- Contact:
Re: split TIF files
Hi,
This is a vb sample to split a multipage tiff image into 2 other multipage tiff:
Best regards,
Loïc
This is a vb sample to split a multipage tiff image into 2 other multipage tiff:
Code: Select all
Dim nMultiPageImageIN As Long
Dim nMultiPageImageOUT As Long
Dim sTiffPathIN As String
Dim sTiffPathOUT As String
Dim nCpt As Long
nMultiPageImageIN = Imaging1.TiffCreateMultiPageFromFile("multipage.tif")
'Her we will save the 3 first pages of the multipage tiff into another multipage tiff
Call Imaging1.TiffSelectPage(nMultiPageImageIN, 1)
nMultiPageImageOUT = Imaging1.TiffCreateMultiPageFromGdPictureImage(nMultiPageImageIN)
For nCpt = 2 To 3
Call Imaging1.TiffSelectPage(nMultiPageImageIN, nCpt)
Call Imaging1.TiffAppendPageFromGdPictureImage(nMultiPageImageOUT, nMultiPageImageIN)
Next nCpt
Call Imaging1.TiffSaveMultiPageToFile(nMultiPageImageOUT, "out1.tif")
Imaging1.CloseImage (nMultiPageImageOUT)
'Her we will save all other pages of the multipage tiff into another multipage tiff
Call Imaging1.TiffSelectPage(nMultiPageImageIN, 4)
nMultiPageImageOUT = Imaging1.TiffCreateMultiPageFromGdPictureImage(nMultiPageImageIN)
For nCpt = 5 To Imaging1.TiffGetPageCount(nMultiPageImageIN)
Call Imaging1.TiffSelectPage(nMultiPageImageIN, nCpt)
Call Imaging1.TiffAppendPageFromGdPictureImage(nMultiPageImageOUT, nMultiPageImageIN)
Next nCpt
Call Imaging1.TiffSaveMultiPageToFile(nMultiPageImageOUT, "out2.tif")
Imaging1.CloseImage (nMultiPageImageOUT)
Imaging1.CloseImage (nMultiPageImageIN)
Loïc
Who is online
Users browsing this forum: No registered users and 2 guests