Author |
Topic  |
|
ettienned

South Africa
12 Posts |
Posted - Mar 08 2017 : 14:33:13
|
Hi I am trying to create many tiff's from a source tiff.
I am trying to use the insertpage method where i get a page from a source handler and source index but all i get is list index out of bounds no matter what i try.
Is there sample code i can look at . The tiffhandler example assumes that i allready have single page tiff's to work with
Regards
Ettienne |
|
w2m
   
USA
1990 Posts |
Posted - Mar 08 2017 : 14:36:39
|
Look at the ImageEn\Demos\InputOutput\TiffHandler demo.
Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development |
 |
|
ettienned

South Africa
12 Posts |
Posted - Mar 08 2017 : 16:13:08
|
hi Bill
I did try before posting but there is no code that i can find that inserts a tiff file from a specific index of another tiff file.
The insert page method that is supposed to do this gives me a list out of bounds error no matter what i do and i made sure that i used a tiff that has images see code below
TiffHand1.InsertPage(-1 ,TiffHand2, 1);
regards ettienne |
 |
|
w2m
   
USA
1990 Posts |
Posted - Mar 08 2017 : 16:14:49
|
Why are you using a tiffhandler? Usually it is not needed.
Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development |
 |
|
xequte
    
39053 Posts |
Posted - Mar 08 2017 : 19:10:44
|
Hi Etienne
Rather than the TIFF Handler, is generally easier to use a TIEMultiBitmap to load and manipulate multi-frame images.
https://www.imageen.com/help/TIEMultiBitmap.html
e.g.
myMBMP := TIEMultiBitmap.create();
myMBMP.read( 'D:\SomeTiff.tiff' );
myMBMP.InsertImage( 4, file, bitmap, etc );
myMBMP.write( 'D:\out.tiff' );
myMBMP.free();
Nigel Xequte Software www.xequte.com nigel@xequte.com |
 |
|
ettienned

South Africa
12 Posts |
Posted - Mar 08 2017 : 21:27:11
|
thanks Nigel
this is what i want to do
i have a tiff with 10 images and want to create another tiff using only image 1,image 6 and image 9 from the original tiff.
So what i saw in the examples is the insertpage method where i can specify the source tiff and source index but always fails with list out of bounds error.
will I be able to do this with TIEMultiBitmap
Regards ettienne
|
 |
|
w2m
   
USA
1990 Posts |
Posted - Mar 09 2017 : 09:53:59
|
I have a tiff with 10 images and want to create another tiff using only image 1,image 6 and image 9 from the original tiff. Will I be able to do this with TIEMultiBitmap?
Yes.
But it is very easy to do this simply by: Loading the tif file into TImageEnMView with ImageEnMView1.MIO.LoadFromFile(AFileName) then save the file with ImageEnMView1.MIO.SaveToFileTiff(SavePictureDialog1.Filename, True);
procedure SaveToFileTIFF(const FileName: string; SelectedOnly: Boolean = False); SaveToFileTiff saves all images in the TImageEnMView or in a TIEMultiBitmap as a TIFF file. If SelectedOnly is True then only the selected images are output.
So to save image 1, 6 and 9 is a multiframe tiff, just select image 1,6 and 9 and call ImageEnMView1.MIO.SaveToFileTiff(SavePictureDialog1.Filename, True);
Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development |
 |
|
ettienned

South Africa
12 Posts |
Posted - Mar 09 2017 : 11:20:14
|
Thanks Bill
What i ended up doing is still use the tiffhandler but only save the images at the index's i need . I needed to do this because sometimes i will have 500 images that needs to be split into multiple files.
It is working 100% now.
regards ettienne |
 |
|
|
Topic  |
|