文档里有,还是设置参数,一样的。
- public void AcquireExample(IntPtr parent)
- {
- acq_session = new TwainSession();
- acq_session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
- acq_session.SelectSource(String.Empty);
- TwainProperties props = acq_session.Properties;
- TwainDataTransferProperties dataProps = props.DataTransfer;
- dataProps.FileName = Path.Combine(LEAD_VARS.ImagesDir, "twain.bmp");
- dataProps.MemoryBufferSize = dataProps.MemoryBufferSize * 2;
- props.DataTransfer = dataProps;
- acq_session.Properties = props;
- TwainTransferOptions opts = acq_session.TransferOptions;
- acq_session.AcquirePage += new EventHandler<TwainAcquirePageEventArgs>(twain_AcquirePage);
- if (acq_session.Acquire(TwainUserInterfaceFlags.Show) != DialogResult.OK)
- MessageBox.Show("Error Acquiring From Source");
- acq_session.Shutdown();
- }
复制代码 |