Updated samples to new twain sessions.

This commit is contained in:
soukoku
2014-04-05 21:54:08 -04:00
parent c5a2f2c73a
commit 4c3e2a50b3
8 changed files with 197 additions and 51 deletions

View File

@@ -20,7 +20,7 @@ namespace Tester.Winform
sealed partial class TestForm : Form
{
ImageCodecInfo _tiffCodecInfo;
TwainSessionOld _twain;
TwainSessionWinform _twain;
bool _stopScan;
bool _loadingCaps;
@@ -60,11 +60,8 @@ namespace Tester.Winform
private void SetupTwain()
{
var appVer = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);
TWIdentity appId = TWIdentity.Create(DataGroups.Image, new Version(appVer.ProductMajorPart, appVer.ProductMinorPart),
"My Company", "Test Family", "Tester", "A TWAIN testing app.");
_twain = new TwainSessionOld(appId);
var appId = TWIdentity.CreateFromAssembly(DataGroups.Image, Assembly.GetEntryAssembly());
_twain = new TwainSessionWinform(appId);
_twain.DataTransferred += (s, e) =>
{
if (pictureBox1.Image != null)