Scanner csharp

From Ilianko
Revision as of 05:10, 4 May 2015 by Anko (talk | contribs)

xxx

// _twain
// 
this.components = new System.ComponentModel.Container();
this.twain = new Saraff.Twain.Twain32(this.components);
this.twain.AppProductName = "Saraff.Twain, Version=1.0.0.0";
this.twain.Parent = this;
this.twain.AcquireCompleted += new System.EventHandler(this.getScan);
private Saraff.Twain.Twain32 twain;
private void scanner_Click(object sender, EventArgs e)
{
   this.twain.CloseDataSource();
   this.twain.SelectSource();
}
private void scanButton_Click(object sender, EventArgs e)
{
  this.twain.Acquire();
}
private void getScan(object sender, EventArgs e)
{
  if ( twain.ImageCount > 0)
  {
    pictureBox1.Image = twain.GetImage(0);
  }
}