FindFastConfiguration方法

总结

(仅限文档/医疗)确定最佳扫描仪配置。

语法
c#
VB
c++
公共函数FindFastConfiguration (_按值传递workingFolder作为字符串, _按值传递旗帜作为TwainFastUserInterfaceFlags, _按值传递bitsPerPixel作为整数, _按值传递bufferIteration作为整数, _按值传递userConfigurations作为IList接口(TwainFastConfiguration) _作为TwainFindFastConfigurationResult

参数

workingFolder
保存测试图像的工作文件夹的路径。

旗帜
指示是否显示制造商的用户界面。有关可能值的列表,请参阅Leadtools.Twain.TwainFastUserInterfaceFlags控制用户界面的显示和方法操作的标志。

bitsPerPixel
结果文件的像素深度。

注意,并不是所有的像素位都适用于所有的文件格式。bitsPerPixel使用0来存储使用该格式支持的最接近的bitsPerPixel值的文件。

bufferIteration
将要测试的内存配置的数量。该参数的最大值为10。

userConfigurations
需要测试的配置。

返回值

TwainFindFastConfigurationResult,表示测试TWAIN源的最佳和最快配置。

讲话

为了尽可能快地扫描图像,有必要使用最快的扫描配置。使用FindFastConfiguration方法测试所选扫描仪的扫描配置SelectSource方法。

有关更多信息,请参阅快速TWAIN(扫描配置).此函数在运行时显示一些辅助消息框,用于指导用户完成正在运行的测试。如果你希望屏蔽这些信息,那就通过TwainFastUserInterfaceFlags。SuppressMessageBoxes标记,这些消息将停止显示。

例子
c#
VB
使用Leadtools;使用Leadtools.Twain;公共无效twain_FastConfiguration (对象发送者:TwainFastConfigurationEventArgs/ /……在这里设置代码e.Stop =公共无效FindFastConfigurationExample (IntPtr父)TwainSession session =TwainSession ();会话。启动(父,“制造商”“productFamily”“版本”“应用程序”, TwainStartupFlags.None);会话。EnableFastConfigurationEvent =真正的会话。FastConfiguration + =EventHandler < TwainFastConfigurationEventArgs > (twain_FastConfiguration);List twFastConfig =TwainFastConfiguration tempFastConfig =TwainFastConfiguration ();tempFastConfig = TwainFastConfiguration.Default;tempFastConfig。TransferMechanism = TwainTransferMode.File;tempFastConfig。ImageFormat = Leadtools.RasterImageFormat.Bmp;tempFastConfig。BitsPerPixel = 1;twFastConfig.Add (tempFastConfig);tempFastConfig。TransferMechanism = TwainTransferMode.File;tempFastConfig。ImageFormat = Leadtools.RasterImageFormat.Tif;tempFastConfig。BitsPerPixel = 1;twFastConfig.Add (tempFastConfig);TwainFindFastConfigurationResult fastConfigRes;试一试fastConfigRes = session.FindFastConfiguration(Path.Combine(LEAD_VARS.ImagesDir,""), TwainFastUserInterfaceFlags。Show, 0,1, twFastConfig);字符串味精;对话框。显示(“FindFastConfig方法成功”);msg =字符串。格式("结果扫描配置计数= {0}", fastConfigRes.Tested.Count);MessageBox.Show(味精);msg =字符串。格式("传输模式= {0}\nFile Format = {1}\nBuffer Size = {2}\nRequired Time = {3}\n"fastConfigRes.Tested [0] .TransferMechanism,fastConfigRes.Tested [0] .ImageFormat,fastConfigRes.Tested [0] .BufferSize,fastConfigRes.Tested [0] .RequiredTime);对话框。显示(味精,“已测试扫描配置…”);msg =字符串。格式("传输模式= {0}\nFile Format = {1}\nBuffer Size = {2}\nRequired Time = {3}\n"fastConfigRes.Best.TransferMechanism,fastConfigRes.Best.ImageFormat,fastConfigRes.Best.BufferSize,fastConfigRes.Best.RequiredTime);对话框。显示(味精,“最佳扫描配置…”);(异常交货)MessageBox.Show (ex.Message);session.Shutdown ();静态LEAD_VARS公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”
进口Leadtools进口Leadtools。吐温公共twain_FastConfiguration (按值传递发送方作为对象按值传递e作为TwainFastConfigurationEventArgs)“…在这里设置代码e。停止结束公共FindFastConfigurationExample (按值传递作为IntPtr)昏暗的会话作为TwainSession =TwainSession ()会话。启动(父,“制造商”“productFamily”“版本”“应用程序”TwainStartupFlags.None)会话。EnableFastConfigurationEvent =真正的AddHandler会话。FastConfiguration,AddressOftwain_FastConfiguration昏暗的twFastConfig作为List(TwainFastConfiguration) =没有什么昏暗的tempFastConfig作为TwainFastConfiguration =TwainFastConfiguration ()tempFastConfig = TwainFastConfiguration。默认的tempFastConfig。TransferMechanism = TwainTransferMode。文件tempFastConfig。ImageFormat = Leadtools.RasterImageFormat.BmptempFastConfig。BitsPerPixel = 1twFastConfig.Add (tempFastConfig)tempFastConfig。TransferMechanism = TwainTransferMode。文件tempFastConfig。ImageFormat = Leadtools.RasterImageFormat.TiftempFastConfig。BitsPerPixel = 1twFastConfig.Add (tempFastConfig)昏暗的fastConfigRes作为TwainFindFastConfigurationResult试一试fastConfigRes = session.FindFastConfiguration(Path.Combine(LEAD_VARS.ImagesDir,""), TwainFastUserInterfaceFlags。Show, 0,1, twFastConfig)昏暗的味精作为字符串对话框。显示(“FindFastConfig方法成功”味精=字符串.Format ("结果扫描配置计数= {0}", fastConfigRes.Tested。MessageBox.Show(味精)味精=字符串.Format (“传输模式={0}”&常数。vbLf &"文件格式= {1}"&常数。vbLf &"Buffer Size = {2}"&常数。vbLf &"所需时间= {3}"&常数。.TransferMechanism vbLf, fastConfigRes.Tested (0),fastConfigRes.Tested(0)。ImageFormat fastConfigRes.Tested(0)。BufferSize, fastConfigRes.Tested (0) .RequiredTime)对话框。显示(味精,“已测试扫描配置…”味精=字符串.Format (“传输模式={0}”&常数。vbLf &"文件格式= {1}"&常数。vbLf &"Buffer Size = {2}"&常数。vbLf &"所需时间= {3}"&常数。vbLf fastConfigRes.Best.TransferMechanism,fastConfigRes.Best.ImageFormat,fastConfigRes.Best.BufferSize,fastConfigRes.Best。RequiredTime)对话框。显示(味精,“最佳扫描配置…”前女友作为异常MessageBox.Show (ex.Message)结束试一试session.Shutdown ()结束公共NotInheritableLEAD_VARS公共常量ImagesDir作为字符串“C: \ LEADTOOLS21 \ Resources \图片”结束
需求

目标平台

Leadtools。吐温作为sembly
188金宝搏的网址客服|支持|联系我们|知识产权公告
©1991 - 2021领德科技有限公司版权所有。