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, July 11, 2005 1:31:19 PM(UTC)
PaulTMonument

Groups: Registered
Posts: 6


I am using LeadTools to read in a (1bit pp) multi-page CCITT Group 3 faximage and then write
out to a CCITT Group 4 fax image. I can open the file and save it but only the 1st page is saved
in CCITT Group 4 fax image. I believe that I need to somehow iterate through each frame and save
each one back out. My problem is how do I tell it which frame to save?
TheRetVal=LT.Load("c:\\mytiff_G3.tif",0,0,1);
TheRetVal=LT.Save("c:\\mytiff_G4.tif",29,1,2,0);

Edited by moderator Thursday, October 20, 2016 10:41:08 AM(UTC)  | Reason: Removed defunct emoticon

 

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 : Monday, July 11, 2005 11:20:25 PM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,022

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

To determine which page to save, set BitmapListIndex to the index of
the desired page, then call Save.  The index is zero-based. 
To save all pages to a single file, you should iterate through all
pages and pass SAVE_APPEND to the last parameter of Save.  The code should  look something like this:

For i = 0 to LT.BitmapListCount - 1
    LT.BitmapListImdex = i
    LT.Save filename, FILE_TIF, 1, 2, SAVE_APPEND
Next i
 
#3 Posted : Tuesday, July 12, 2005 6:33:42 AM(UTC)
PaulTMonument

Groups: Registered
Posts: 6


Thanks for your reply...
When I go and run your save it create a CCITT GROUP 4 TIF file but with only 1 page? (the source file is 2 pages)
When I trace the 1st save for the 1st page it works... The 2nd save for the 2nd page returns
a 20002 or ERROR_NO_BITMAP.  I checked the source file and it does infact have 2 pages.
Also LT.BitMapListCount says 1 which I assume means two pages right?

Here is my code...

TheRetVal=LT.Load(SourceFILE,0,0,1);
TheRetVal=LT.Size(Width, Height, 0);
LT.BitmapXRes = 204;
LT.BitmapYRes = 196;
LT.ForceRepaint();

for(int ii=0; ii<=LT.BitmapListCount; ii++)
{
   LT.BitmapListIndex = (
short)ii;
   TheRetVal=LT.Save(TempTargetFile, 29, 1, 2, 1);
//FILE_CCITT_GROUP4=29 FILE_CCITT_GROUP3_1DIM SAVE_APPEND=1
}

Thanks very much   Paul

 
#4 Posted : Thursday, July 14, 2005 3:38:39 PM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

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

Please note the following:
1. BitmapListCount contains the number of bitmaps. A value of 1 means only one page, not 2.
2. This means BitmapListIndex varies from 0 to (BitmapListCount-1).

3. To load multiple pages of a file at once into the BitmapList, pass
the number of pages in the last parameter of the Load method (lPages). To load all pages, pass -1 (minus one).


The cause of error code you got was assigning 1 to BitmapListIndex and
trying to save. Your list had only 1 image, which means the BitmapListIndex can only be 0.

Amin Dodin
LEADTOOLS Technical Support

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
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.