Home | About us | Overview | Softwares - Downloads | Evaluate | Order | Support | old forums | Contact | F.A.Q. | Documentations | Search | Sitemap

split TIF files

Example requests & Code samples for GdPicture ActiveX.

split TIF files

Postby paulo moura on Fri Jul 11, 2008 5:30 am

Hi Loic !
How we can split a TIF multipage file in various TIF singlepage files ?
Thank you in advance.
Paulo Moura
User avatar
paulo moura
 
Posts: 4
Joined: Thu Sep 06, 2007 10:12 pm
Location: Brasil

Re: split TIF files

Postby Loïc on Fri Jul 18, 2008 11:24 am

Hi,

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)


Best regards,

Loïc
User avatar
Loïc
Site Admin
 
Posts: 1195
Joined: Tue Oct 17, 2006 11:48 pm
Location: France


Return to Example requests & Code samples

Who is online

Users browsing this forum: No registered users and 0 guests