#include "ltwrappr.h"
L_INT LTwain::SetImageUnit (nUnit)
L_INT nUnit; |
image unit |
Sets the image unit value used to transfer images from the current TWAIN source.
Parameter |
Description |
nUnit |
Specifies the unit value to set. For more information on possible values, refer to http://www.twain.org/ and click on TWAIN Specification (Version 1.9). |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
This function internally sets the image unit capability ICAP_UNITS. For more information on this capability, refer to http://www.twain.org/ and click on TWAIN Specification (Version 1.9).
To obtain the current image unit value, call the LTwain::GetImageUnit function.
Required DLLs and Libraries
LTTWN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
L_INT LTwain__SetImageUnitExample(LTwain * plTwain)
{
L_INT nRet = SUCCESS;
L_INT nUnit;
nRet = plTwain->GetImageUnit (&nUnit);
if (nRet == SUCCESS)
{
if (nUnit == TWUN_INCHES)
{
nRet = plTwain->SetImageUnit(TWUN_INCHES);
if(nRet != SUCCESS)
return nRet;
}
}
else
return nRet;
L_INT nBPP;
nRet = plTwain->GetImageBitsPerPixel (&nBPP);
if (nRet == SUCCESS)
{
if (nBPP == 24)
plTwain->SetImageBitsPerPixel (24);
}
else
return nRet;
return SUCCESS;
}