FindFastConfig Example for Visual FoxPro 6
#define L_LTWAIN_SHOW_USER_INTERFACE 1
#define FILE_TIF 3
#define L_LTWAIN_FILE_MODE 1
#define FILE_BMP 6
oRasterTwain.EnableFastConfigEvent = .T.
oRasterTwain.UserFastConfigsCount = 2
oRasterTwain.UserFastConfigs(0).TransferMode = L_LTWAIN_FILE_MODE
oRasterTwain.UserFastConfigs(0).FileFormat = FILE_BMP
oRasterTwain.UserFastConfigs(0).BitsPerPixel = 1
oRasterTwain.UserFastConfigs(1).TransferMode = L_LTWAIN_FILE_MODE
oRasterTwain.UserFastConfigs(1).FileFormat = FILE_TIF
oRasterTwain.UserFastConfigs(1).BitsPerPixel = 1
nRet = oRasterTwain.FindFastConfig("c:\Twain", L_LTWAIN_SHOW_USER_INTERFACE, 1, 0)
If nRet = 0 Then
MessageBox("FindFastConfig method was successful")
MessageBox("Result Scan Configs count = " + Str(oRasterTwain.FastConfigsResultCount))
str = "Transfer Mode = " + Str(oRasterTwain.FastConfigsResult(0).TransferMode) + Chr(13) + ;
"File Format = " + Str(oRasterTwain.FastConfigsResult(0).FileFormat) + Chr(13) + ;
"Buffer Size = " + Str(oRasterTwain.FastConfigsResult(0).BufferSize) + Chr(13) + ;
"Required Time = " + Str(oRasterTwain.FastConfigsResult(0).RequiredTime)
MessageBox(str, 0, "Result Scan Configurations...")
str = "Transfer Mode = " + Str(oRasterTwain.BestFastConfig.TransferMode) + Chr(13) + ;
"File Format = " + Str(oRasterTwain.BestFastConfig.FileFormat) + Chr(13) + ;
"Buffer Size = " + Str(oRasterTwain.BestFastConfig.BufferSize) + Chr(13) + ;
"Required Time = " + Str(oRasterTwain.BestFastConfig.RequiredTime)
MessageBox(str, 0, "Resulting Scan Configurations...")
Else
MessageBox("Error occurred in the FindFastConfig method!!!", 0, "Error!!!")
EndIf
For details about implementing the event, see the tutorial Acquiring an Image.
PROCEDURE FastConfigEvent(pltResConfig)
&& ... set your code here
oRasterTwain.StopFindFastConfig = .F.
ENDPROC