This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#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....
Thanks,
Jebby
#2
Posted
:
Sunday, May 28, 2006 12:31:16 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
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.
Thanks,
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.