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



Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, May 23, 2006 1:36:38 PM(UTC)


Groups: Registered
Posts: 1

I have a multipage tiff, using the c++ classlib lead tools and attempting to save like so:

string sFilePath = "c:\\temp.tif";
LBitmapbase* mybmp = remote->GetLBitmap(); // GetLBitmap returns a valid Bitmapbase ptr

L_INT LRet = mybmp->Save(const_cast<L_TCHAR*>(sFilePath.c_str()),FILE_TIF,0,0,2,-1);

LRet returns as -1002 every time.  I'm at a loss as to what could be causing my problems.  Does it matter what the input file's format was that was used to create the LBitmapBase?  Is there something else going on here?  I'm using Lead Tools 14....




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 : Sunday, May 28, 2006 12:31:16 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

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


Error number -1002 means invalid parameter(s) passed (please refer to the "Return Codes" topic in the LEADTOOLS C++ Class Library documentation). If you checked the LBitmapBase::Save method in the documentation, you will notice that the save function takes the following parameters:
>> BitmapBase.Save(pszFile, nFormat, nBitsPerPixel, nQFactor, nPageNumber, uFlags, pSaveOptions)
Now, you are trying to save TIFF files as follows:
>> mybmp->Save(const_cast<L_TCHAR*>(sFilePath.c_str()),FILE_TIF,0,0,2,-1);
pszFile = const_cast<L_TCHAR*>(sFilePath.c_str())
nFormat= FILE_TIF
nBitsPerPixel = 0
nQFactor = 0
nPageNumber = 2
uFlags = 2 (SAVE_REPLACE)
pSaveOptions = -1 (this is wrong. You can't pass -1 to the pSaveOptions parameter).

To resolve the problem, try to pass NULL to the pSaveOptions parameter and retry this issue.

Maen Badwan
LEADTOOLS Technical Support
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-2021, Yet Another Forum.NET
This page was generated in 0.097 seconds.