This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, August 20, 2007 12:12:32 PM(UTC)
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.
#2
Posted
:
Wednesday, August 22, 2007 2:31:12 AM(UTC)
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.