(仅限文档/医疗)确定最佳扫描仪配置。
公共TwainFindFastConfigurationResultFindFastConfiguration (
字符串workingFolder,
TwainFastUserInterfaceFlags旗帜,
intbitsPerPixel,
intbufferIteration,
IList <TwainFastConfiguration>userConfigurations
)
公共函数FindFastConfiguration (_
按值传递workingFolder作为字符串, _
按值传递旗帜作为TwainFastUserInterfaceFlags, _
按值传递bitsPerPixel作为整数, _
按值传递bufferIteration作为整数, _
按值传递userConfigurations作为IList接口(TwainFastConfiguration) _
)作为TwainFindFastConfigurationResult
公共:
TwainFindFastConfigurationResultFindFastConfiguration (
字符串^workingFolder,
TwainFastUserInterfaceFlags旗帜,
intbitsPerPixel,
intbufferIteration,
IList <TwainFastConfiguration> ^userConfigurations
)
workingFolder
保存测试图像的工作文件夹的路径。
旗帜
指示是否显示制造商的用户界面。有关可能值的列表,请参阅Leadtools.Twain.TwainFastUserInterfaceFlags控制用户界面的显示和方法操作的标志。
bitsPerPixel
结果文件的像素深度。
注意,并不是所有的像素位都适用于所有的文件格式。bitsPerPixel使用0来存储使用该格式支持的最接近的bitsPerPixel值的文件。
bufferIteration
将要测试的内存配置的数量。该参数的最大值为10。
userConfigurations
需要测试的配置。
TwainFindFastConfigurationResult,表示测试TWAIN源的最佳和最快配置。
为了尽可能快地扫描图像,有必要使用最快的扫描配置。使用FindFastConfiguration方法测试所选扫描仪的扫描配置SelectSource方法。
的数组来测试用户定义或自定义配置TwainFastConfiguration对象的userConfigurations参数。FindFastConfiguration方法。
要测试TWAIN驱动程序可用的默认配置,请通过零为userConfigurations参数。
若要测试所选扫描仪的每像素支持的所有位,请设置TwainFastUserInterfaceFlags。CheckDefaultBitsPerPixel在旗帜.方法中指定的每像素位数bitsPerPixel参数。
如果TwainFastUserInterfaceFlags。UseThread设置在旗帜,图像采集进程将以线程模式运行。在某些扫描仪中,以线程模式获取图像将提高获取图像的速度。在其他扫描器(例如高速扫描器)中,以线程模式获取图像对获取一个或多个图像的速度几乎没有改善。
的bitsPerPixel参数和TwainFastUserInterfaceFlags。CheckDefaultBitsPerPixel标志,仅当正在测试的扫描配置的传输模式为TwainTransferMechanism。内存或TwainTransferMechanism。本地的.
的bufferIteration值确定要测试的缓冲区大小。测试具有不同缓冲区大小的内存传输模式的目的是确定将提供最快扫描配置的缓冲区大小。缓冲区迭代指定要测试的缓冲区大小的数量。缓冲区大小是TWAIN源传输数据的大小。
若要停止扫描配置测试进程,请设置停止财产真正的在FastConfiguration事件。若要继续扫描配置过程,请设置停止财产假.
有关更多信息,请参阅快速TWAIN(扫描配置).此函数在运行时显示一些辅助消息框,用于指导用户完成正在运行的测试。如果你希望屏蔽这些信息,那就通过TwainFastUserInterfaceFlags。SuppressMessageBoxes标记,这些消息将停止显示。
使用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.Bmp
tempFastConfig。BitsPerPixel = 1
twFastConfig.Add (tempFastConfig)
tempFastConfig。TransferMechanism = TwainTransferMode。文件
tempFastConfig。ImageFormat = Leadtools.RasterImageFormat.Tif
tempFastConfig。BitsPerPixel = 1
twFastConfig.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 ()
结束子
公共NotInheritable类LEAD_VARS
公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”
结束类
帮助收藏
光栅net|C API|c++类库|HTML5 JavaScript
文档net|C API|c++类库|HTML5 JavaScript
医疗net|C API|c++类库|HTML5 JavaScript
医疗网络查看器net
188宝金博怎么下载
支持的平台上
.NET、Java、Android和iOS/macOS程序集
C API/ c++类库
HTML5 JavaScript库
您的邮件已发送给技术支持!应该有人联系!如果你的事情很紧急,请回来聊天。
聊天时间:
周一至周五,美国东部时间上午8:30至下午6:00
感谢您的反馈!
请再次填写表格,开始新的聊天。
所有代理目前都离线。
聊天时间:
星期一至星期五
美国东部时间上午8:30 -下午6点
如需与我们联系,请填写此表格,我们将通过电子邮件与您联系。