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
 TIETIFFHandler Compression
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Elemental

USA
56 Posts

Posted - Apr 22 2014 :  09:36:01  Show Profile  Reply
Is there a way to specify the TIFF compression used with TIETIFFHandler.WriteFile? I, for one, would like to specify ioTIFF_G4FAX as the TIOTIFFCompression type used. I am writing the file from a series of TIEBitmaps that get converted to Streams and then appended to the handler.

w2m

USA
1990 Posts

Posted - Apr 22 2014 :  09:54:25  Show Profile  Reply
I do not think the TIFHandler allows you to set the compression. I suspect you need to use TImageEnMIO instead:

ImageEnMView1.MIO.Params[ImageEnMView1.SelectedImage].TIFF_Compression := ioTIFF_G4FAX;
ImageEnMView1.MIO.SaveToFile(AFilename);

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development
Go to Top of Page

Elemental

USA
56 Posts

Posted - Apr 22 2014 :  09:58:21  Show Profile  Reply
I can't use TImageEnMView's MIO property in my project. As it stands, the TImageEnMView on my form shows the annotated pages from TImageEnVect. This is great for printing, exporting as various file types (including TIFF), and so forth. But my project requires that the TIFF be saved without annotations; annotations are saved in a database and loaded on demand. Therefore, I have a TIETIFFHandler do the job for me. I kinda wish that TImageEnMView and TIETIFFHandler were better coupled than just through streams.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 22 2014 :  10:49:32  Show Profile  Reply
I suppose you could have a "hidden" not visible TImageEnMView and then copy the images from the tiff handler to the hidden TImageEnMView or a TIEMIO component and then use the TImageEnMView or TImageEnMIO to save the file with the the compression parameter.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development
Go to Top of Page

Elemental

USA
56 Posts

Posted - Apr 22 2014 :  11:36:18  Show Profile  Reply
I'll think on it some more, because it seems that your solution might take up a whole lot of memory, and some of these documents are quite large. It seems like having two TImageEnMViews, with most of the same images, would take up twice as much space in RAM.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 22 2014 :  12:06:59  Show Profile  Reply
I am sure memory requirements would increase....

William Miller
Go to Top of Page

xequte

38510 Posts

Posted - Apr 25 2014 :  17:13:32  Show Profile  Reply
Hi

TIETiffHandler is not suitable for your requirements because it does not handle custom compression.

So you could use a hidden TImageEnMView. You are unlikely to have memory issues unless your images are huge.

Another option is to code your own code only solution. Have a look at the source of TImageEnMIO.SaveToFileTIFF and TImageEnMIO.SaveToStreamTIFF. You need only replace the calls to retrieve the Bitmap and params from the TImageEnMView with your own source.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

xequte

38510 Posts

Posted - May 04 2014 :  19:33:58  Show Profile  Reply
Oops, neglected to mention another non visual option.

Attach an IEBitmap to a TImageEnIO, and then call:

http://www.imageen.com/help/TImageEnIO.InsertToFileTIFF.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: