The Hello World Sample

The purpose of this sample is to provide the basic idea about what the Dynamic Web TWAIN ActiveX Control looks like.

  1. Start the Microsoft Visual Basic 6. Create a "Standard EXE" application.
  2. From the "Project" menu, click "Component".
  3. In the "Components" dialog box, check "Dynamic Web TWAIN By Dynamsoft". Click "Ok" to close the dialog box.
  4. Add a CommandButton Control to the form. Change the Caption Property to "Acquire". Change the Name Property to "btnAcquire".
  5. Add a Dynamic Web TWAIN Control to the form. Change the BorderStyle Property to "Single3D". Resize the control.
  6. Add the following code:
     
    VB Sample:
     Private Sub btnAcquire_Click()
         DynamicWebTwain1.AcquireImage
     End Sub
  7. Run the application. After acquiring an image from a source, it should be like this:

Remarks

  1. From this simple sample, we can see the power of the Dynamic Web TWAIN. Just with one line of code, an image can be acquired from a source and displayed in a form.
  2. With the built-in Wizard Mode, which handles the TWAIN state transition intelligently, the single line of AcquireImage makes the default data source to be ready for image acquiring.
  3. During the acquiring process, the OnPreAllTransfers Event, OnPreTransfer Event, OnPostTransfer Event and OnPostAllTransfers Event are triggered. In this sample, we do not need to handle any of them.

  4. The similar samples are available in Visual C++, Visual Basic, Delphi, C# and VB.NET. The name of the sample is TheMinimumSystem.