DTWAIN_ArrayConvertFloatToFix32

Top  Previous  Next

The DTWAIN_ArrayConvertFloatToFix32 creates a DTWAIN_ARRAY of fixed point values from a DTWAIN_ARRAY of DTWAIN_FLOAT values.

 

DTWAIN_ARRAY DTWAIN_ArrayConvertFloatToFix32 ( DTWAIN_ARRAY Array )

 

Parameters

Array

A DTWAIN_ARRAY that holds DTWAIN_FLOAT values.

 

 

Return Values

If the function succeeds, a new DTWAIN_ARRAY is returned that contains fixed point values.  Otherwise, NULL is returned.

 

Comments

The DTWAIN_ArrayConvertFloatToFix32 function returns a new DTWAIN_ARRAY that holds fixed point values that are equivalent to the floating point values in the DTWAIN_ARRAY that was passed in.

 

A DTWAIN_ARRAY of fixed point values can be used to set or get entries that represent floating point values, but instead the fixed point entry will use integers to represent the whole number and decimal portions of the floating point number.  If DTWAIN_ArrayConvertFloatToFix32 succeeds, the original DTWAIN_ARRAY of DTWAIN_FLOAT values that was passed to DTWAIN_ArrayConvertFloatToFix32 is destroyed and no longer can be used.

 

This function is useful if the computer language used to write your application doesn't use or handle DTWAIN_FLOAT variable types correctly, and you want to call DTWAIN functions that return or use DTWAIN_FLOAT values (for example DTWAIN_GetCapValues or DTWAIN_SetCapValues for capabilities that require floating point values, or a function such as DTWAIN_EnumResolutionValues that return a DTWAIN_ARRAYFLOAT of resolution values).   See these examples for usage of this and other functions that handle floating point data.

 

Since most computer languages handle DTWAIN_FLOATS with no issues, the DTWAIN_ArrayConvertFloatToFix32 should rarely be used, if it is ever used.

 

To convert a DTWAIN_ARRAY of fixed point values to a DTWAIN_ARRAY of floating point values, use the DTWAIN_ArrayConvertFix32ToFloat function.  To set/get each of the components (whole and fractional) an entry in the DTWAIN_ARRAY of fixed point values, use the DTWAIN_ArrayFix32SetAt and DTWAIN_ArrayFix32GetAt functions.

 

TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize