DTWAIN_SetAcquireImageScale |
Top Previous Next |
The DTWAIN_SetAcquireImageScale function sets or resets the current image acquisition area.
DTWAIN_BOOL DTWAIN_SetAcquireImageScale (
Parameters Source An open TWAIN Source.
xScale X-Scaling value.
yScale Y-Scaling value.
Return Values The return value is TRUE if successful. Otherwise FALSE is returned.
Comments The DTWAIN_SetAcquireImageScale function sets the scaling for the x-axis (horizontal) and y-axis (vertical) scaling for the acquired images. The scaling values are fractional units, where 1.0 represents 100% (no scaling). Therefore if the scaling value is 0.5, the acquired image will be 50% smaller than the original image on the desired axis. The xScale sets the x-axis scaling, and yScale represents the y-axis scaling.
DTWAIN_SetAcquireImageScale must be called before the DTWAIN acquire functions or when the DTWAIN_TN_TRANSFEREADY or DTWAIN_TN_TRANSFERDONE notifications are sent to your application.
With DTWAIN_SetAcquireImageScale, thumbnail images can be easily created of the scanned images. An example of the usage of DTWAIN_SetAcquireImageScale would be to reduce a 1000 x 500 image to 1/4 this size in both the horizontal and vertical. The correct call would be:
DTWAIN_SetAcquireImageScale( Source, 0.25, 0.25 );
This sets the scaling in the x and y axis to half the original size. To reset the scaling to 100%:
DTWAIN_SetAcquireImageScale( Source, 1.0, 1.0 );
For languages that have difficulties with DTWAIN_FLOAT parameters, the alternate function that can be used as a replacement for DTWAIN_SetAcquireImageScale is DTWAIN_SetAcquireImageScaleString.
Prerequisite Function Call(s) DTWAIN Source Selection Function
See Also Setting / Getting Acquisition Area
|