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 : Tuesday, November 8, 2005 4:33:41 AM(UTC)

nrehman  
nrehman

Groups: Registered
Posts: 7


My application displays 4 pages at once of a multi-page TIFF file.  I have four viewer controls on my form, but a single RasterImage object.  Unfortunately, the RasterImage can only have one active page, so I can't display a different page on each viewer control.  Is there a concept of a "Page" object?  How can I view multiple pages at the same time of a single RasterImage?

 

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 : Tuesday, November 8, 2005 8:22:25 AM(UTC)

ryoder  
ryoder

Groups: Registered
Posts: 7


I had the same problem and in order to get around the limitation I created a RasterImage for each page in the original image.

 

 
#3 Posted : Tuesday, November 8, 2005 11:57:13 PM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

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

This will not work with only one Raster object because - as you said -
a Raster object can have only one active page.  You will need to use a Raster object for each viewer.

Bashar Abdulqaiyume
LEAD Technologies, Inc.
 
#4 Posted : Wednesday, November 9, 2005 5:57:39 AM(UTC)

nrehman  
nrehman

Groups: Registered
Posts: 7


Thanks.  What would be the most optimal way to take a multi-page RasterImage, and create individual RasterImages for each page?  Sample code would be appreciated.

 
#5 Posted : Thursday, November 10, 2005 3:42:27 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

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

Code (in VB) would look something like this:

RasterIO.Load RasterObj, "filename", 0, 1, -1
For i = 1 to RasterObj.BitmapListCount - 1
    RasterObj.BitmapListIndex = i
    RasterIO.Save RasterObj, ..., FILE_OVERWRITE
Next i
 
#6 Posted : Thursday, November 10, 2005 7:24:35 AM(UTC)

nrehman  
nrehman

Groups: Registered
Posts: 7


I am using your .NET version.  I don't see those objects/methods.  Also, I would like to create the split up RasterImages in memory, and not save to file.  (I'm using C#, but VB.NET samples are fine.)
 
#7 Posted : Sunday, November 13, 2005 1:09:38 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

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

Call this line to load all the pages to memory:

rasterImage = rasterCodecs.Load(ImageName, 0, CodecsLoadByteOrder.BgrOrGray, 1, -1);

You can access each page using the rasterImage.Page property.


If you want to save each page into a separate memory buffer you can use
the Save method in a loop and save to a stream.  Is that what you need?
 
#8 Posted : Monday, November 14, 2005 11:47:38 AM(UTC)

nrehman  
nrehman

Groups: Registered
Posts: 7


I need to keep each page in memory as a separate RasterImage object.  I don't need to save to stream just yet.  What is the most efficient way to create a new RasterImage object out of the current page? Thanks.

 
#9 Posted : Wednesday, November 16, 2005 3:21:37 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

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

Use the clone method, which copies the active page only.  Try something like this:

for (int i = 1; i <= rasterImage.PageCount; i++)
{
    rasterImage.page = i;
    images[i - 1] = rasterImage.Clone();
}

where images is an array of RasterImage references.
 
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.101 seconds.