How to add an event into my app?

Dynamic .NET TWAIN provides you with varies of events to make further operations apart from scan and upload. For example, you can trigger an operation after all images are acquired. Or use your mouse to select and acquire text's coordinates. To explore all events of the toolkit, please click here>>

In this article, we will show you how to introduce an event into your app powered by Dynamic .NET TWAIN. Firstly, you need to know how to use the imaging toolkit in Microsoft Visual Studio .NET. Please click here to learn how to add the DLL in your customized app.

Assume you have a Windows Forms Application and have all control and buttons set. Then, please follow the steps below:

  1. Highlight the TWAIN object on the form (the object can be dragged from Toolbox and drop onto this form).
  2. Click on Event button in Properties dialog box.
  3. Find the event you want to add and double click.

At this point, your main window jumps to the code page and the event function is added. You can add a pop up window to test if it is working.

Code:

private void dynamicDotNetTwain1_OnImageAreaSelected(short sImageIndex, int left, int top, int right, int bottom)     
    {
         MessageBox.Show("This is the " + sImageIndex + "th page.");
    }

Pop up:

Please feel free to explore out other events by yourself. If you have any questions, please don't hesitate to contact us.

Is this page helpful?

Leave a Reply

Your email address will not be published.