ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Tiff Handler
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

ettienned

South Africa
12 Posts

Posted - Mar 08 2017 :  14:33:13  Show Profile  Reply
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  Show Profile  Reply
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
Go to Top of Page

ettienned

South Africa
12 Posts

Posted - Mar 08 2017 :  16:13:08  Show Profile  Reply
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
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 08 2017 :  16:14:49  Show Profile  Reply
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
Go to Top of Page

xequte

39053 Posts

Posted - Mar 08 2017 :  19:10:44  Show Profile  Reply
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
Go to Top of Page

ettienned

South Africa
12 Posts

Posted - Mar 08 2017 :  21:27:11  Show Profile  Reply
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

Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 09 2017 :  09:53:59  Show Profile  Reply
 
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
Go to Top of Page

ettienned

South Africa
12 Posts

Posted - Mar 09 2017 :  11:20:14  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: