LIsis::AcquireMulti
#include "Ltwrappr.h"
virtual L_INT LIsis::AcquireMulti(pszBaseFileName, uFlags=0, nFormat=FILE_TIF, bMultiPageFile=TRUE, pnPagesDiscarded=NULL)
/* base string */ | |
L_UINT32 uFlags; |
/* option flags */ |
L_INT nFormat; |
/* format type for saving the image */ |
L_BOOL bMultiPageFile; |
/* flag that indicates whether to save as a multipage file */ |
/* pointer to a variable that is updated with the number of discarded pages */ |
Starts a multipage ISIS scan. Each page will be saved in the specified format in either a multipage file, or as individual files.
This function is available in the Document/Medical Toolkits.
Parameter |
Description |
|
pszBaseFileName |
Character string containing the base string from which page names will be generated. |
|
uFlags |
Option flags. Possible values are: |
|
|
Value |
Meaning |
|
ISIS_SHOWUI |
[0x0001] Shows the ISIS UI. |
|
ISIS_MULTI_NOSAVE |
[0x0002] Do not save data to file. |
|
NULL |
[0x0000] Do not show user interface. |
nFormat |
Value indicating the format to use when saving one or more images to one or more files. The available formats depend on whether or not the data is acquired in compressed form or in uncompressed form. If the data is uncompressed, that is if the ISIS short tag TAG_COMPRESSION has been set to TAG_COMPRESSION_NONE, any format supported by LEADTOOLS is valid. For a list of these formats, refer to Formats of Output Files. |
|
|
If the data is compressed, the type of compression will determine the output format. If a format that is incompatible with the current compression is passed, an error will occur. Possible valid format values and the corresponding compressions are: |
|
|
Value |
Meaning |
|
FILE_CCITT |
[25] Tiff, compressed using CCITT. A file is saved in this format when TAG_COMPRESSION is set to TAG_COMPRESSION_MG3 and nFormat is set to either FILE_CCITT or FILE_FASTEST. |
|
FILE_CCITT_GROUP3_1DIM |
[27] TIFF, compressed using CCITT, group 3, 1 dimension. A file is saved in this format when TAG_COMPRESSION is set to TAG_COMPRESSION_G3 and nFormat is set to either FILE_CCITT_GROUP3_1DIM or FILE_FASTEST. |
|
FILE_CCITT_GROUP4 |
[29] TIFF, compressed using CCITT, group 4. A file is saved in this format when TAG_COMPRESSION is set to TAG_COMPRESSION_G4 and nFormat is set to either FILE_CCITT_GROUP4 or FILE_FASTEST. |
|
FILE_TIFLZW |
[17] TIFF, compressed using LZW. A file is saved in this format when TAG_COMPRESSION is set to TAG_COMPRESSION_LZW and nFormat is set to either FILE_TIFLZW or FILE_FASTEST. |
|
FILE_TIF_PACKBITS |
[87] TIFF, compressed using Packed Bits. A file is saved in this format when TAG_COMPRESSION is set to TAG_COMPRESSION_32771 and nFormat is set to either FILE_TIF_PACKBITS or FILE_FASTEST. |
|
FILE_FASTEST |
[105] Saves the file as a TIFF using the current compression from the scanner. |
bMultiPageFile |
Flag that indicates whether to save as a multipage file, or as individual files for each page. Possible values are: |
|
|
Value |
Meaning |
|
TRUE |
The scanned pages will be saved as pages in a multipage file. |
|
FALSE |
Each scanned page will be saved to an individual file. |
pnPagesDiscarded |
Pointer to an integer that holds the number of pages discarded if scanning were canceled while ScanAhead was enabled. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
If bMultiPageFile is TRUE, the scanned pages will be saved as pages in a multipage file. If bMultiPageFile is FALSE, each scanned page will be saved to an individual file. Filenames are created by concatenating the string in pszBaseFileName with the page number. By default, the numbering will begin with "0001" and will be incremented with each page scanned ("0002","0003", ... ). Each file will be saved according to the format indicated in nFormat. If a file already exists, for example "Page0002", it will be overwritten. The user can control the number of digits used in numbering the filenames by including asterisks '*' in the filename, before the extension. For example, passing "c:\temp\isis\test**.tif" for pszBaseFileName indicates to use only two digits in the filenames (test04.tif), while passing "c:\temp\isis\test*****.tif" for pszBaseFileName indicates to use only five digits in the filenames (test00001.tif). If no asterisks are included, the default of four digits will be used (test0003.tif). You must override LIsis::AcquireMultiCallBack if you want to process each image instead of or in addition to saving the page to disk.
If uFlags is not set, the ISIS user interface will not be activated and the function will only scan the image, using the current scanner driver tags.
Required DLLs and Libraries
LTISI For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Functions: |
|
Topics: |
|
|
Example
// define user ISIS class
class LUserIsis : public LIsis
{
LEAD_DECLAREOBJECT(LUserIsis);
public:
LUserIsis();
LUserIsis(HWND hWnd,LBitmapBase L_FAR* pBitmap);
virtual ~LUserIsis();
virtual L_INT AcquireMultiCallBack(L_INT32 nPage,L_CHAR L_FAR* pszFileName);
};
LEAD_IMPLEMENTOBJECT(LUserIsis);
// constructor and destructor
LUserIsis::LUserIsis()
{
}
LUserIsis::LUserIsis(HWND hWnd,LBitmapBase L_FAR* pBitmap)
{
}
LUserIsis::~LUserIsis()
{
}
L_INT LUserIsis::AcquireMultiCallBack(L_INT32 nPage,L_CHAR L_FAR* pszFileName)
{
/* user receives a bitmap here, when he calls the AcquireMulti function .
for example he can display it or free it */
return SUCCESS ;
}
L_INT MyFunction(HWND hWnd, LBitmapBase *pBitmap)
{
LUserIsis UserIsis ;
L_CHAR szDriverName[255];
L_INT nRet = 0 ;
memset(szDriverName,0,sizeof(szDriverName));
if (UserIsis.IsAvailable() != TRUE)
{
MessageBox( hWnd, "Isis is not available", "Isis Error", MB_OK) ;
return FAILURE ;
}
nRet = UserIsis.Select(szDriverName) ;
if (UserIsis.LoadDriver(szDriverName) == SUCCESS)
{
L_INT32 lWidth ;
L_INT32 lLength ;
L_INT nMaxPages = 1 ;
UserIsis.GetTagLong(TAG_IMAGEWIDTH, &lWidth);
UserIsis.GetTagLong(TAG_IMAGELENGTH, &lLength);
lWidth += 20 ;
lLength += 20 ;
UserIsis.SetTagLong(TAG_IMAGEWIDTH, lWidth);
UserIsis.SetTagLong(TAG_IMAGELENGTH, lLength);
nRet = UserIsis.SetTagShort(TAG_SCANAHEAD, TAG_SCANAHEAD_YES);
if(nRet == SUCCESS)
{
UserIsis.GetTagShort(TAG_MAXPAGES, &nMaxPages);
UserIsis.SetTagShort(TAG_SCANAHEAD_MAXPAGES, (L_INT)(nMaxPages/2));
}
nRet = UserIsis.SetScanOptions() ;
UserIsis.SetBitmap(pBitmap) ;
UserIsis.AcquireMulti("Isis_TIF.TIF",ISIS_SHOWUI) ;
}
UserIsis.UnloadDriver() ;
return SUCCESS ;
}