Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, August 20, 2007 12:12:32 PM(UTC)

cslater  
cslater

Groups: Registered
Posts: 9


I need to implement a function to load a single page from a large tiff.  What would be the best approach?  The code below is just not fast enough.

        // C# 2.0 example
        public IRasterImage LoadPage(string filename, int page)
        {
            RasterCodecs codecs = new RasterCodecs();
            IRasterImage image = codecs.Load(filename);
            image.Page = page;

            return image;
        }

Is there any way to cache the IRasterImage for later calls.  Sometimes I need to come back to the same tiff file for different pages.  I have tried making the IRasterImage a property of the object but somewhere in the process it looses its values.

Help appreciated.

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, August 22, 2007 2:31:12 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

If you know the index of the desired page you want to load, you can try the following load method:

RasterCodecs.Load ( string fileName, int bitsPerPixel, CodecsLoadByteOrder
order, int firstPage, int lastPage)






You can pass the index of the page to the firstPage and lastPage parameters.
Additional tip:
If the files have huge numbers of pages, you can even
improve performance more using some advanced functions that use the Image File
Directory (IFD) of the TIFF file. For details about this, see the help topic "Loading and Saving Large Tiff Files".

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.055 seconds.