Modal scan driver dialog
Posted: Tue Feb 16, 2016 7:07 pm
Hello Vintasoft-team,
i've recognized a problem with the scan driver dialogs. I've set the properties "ShowUI" and "ModalUI" of the Vintasoft.Twain.Device to true, but i still can switch between the scan driver UI and the main application windows.
Example code:
The underlying Vintasoft.Twain.DeviceManager is created with the main application window as parameter in the constructor.
Is this perhaps a known behaviour? Or do i have to call some other method/property to force the twain driver window to be shown as a modal dialog?
Thank you.
Best regards
Daniel
i've recognized a problem with the scan driver dialogs. I've set the properties "ShowUI" and "ModalUI" of the Vintasoft.Twain.Device to true, but i still can switch between the scan driver UI and the main application windows.
Example code:
Code: Select all
bool bFinished = false;
Vintasoft.Twain.Device deTest = null;
Vintasoft.Twain.AcquireModalState amsTest;
this.dmTest.Open();
deTest = this.dmTest.DefaultDevice;
deTest.ShowUI = true;
deTest.ModalUI = true;
deTest.ShowIndicators = false;
deTest.DisableAfterAcquire = false;
deTest.TransferMode = Vintasoft.Twain.TransferMode.Native;
deTest.Open();
deTest.XferCount = -1;
deTest.DocumentFeeder.Enabled = true;
// modal acquiring loop
do
{
amsTest = deTest.AcquireModal();
switch (amsTest)
{
case Vintasoft.Twain.AcquireModalState.ImageAcquired:
if (this.pictureBox1.Image != null)
this.pictureBox1.Image.Dispose();
this.pictureBox1.Image = deTest.AcquiredImage.GetAsBitmap(true);
deTest.AcquiredImage.Dispose();
break;
case Vintasoft.Twain.AcquireModalState.ScanCanceled:
case Vintasoft.Twain.AcquireModalState.ScanCompleted:
case Vintasoft.Twain.AcquireModalState.ScanFailed:
case Vintasoft.Twain.AcquireModalState.UserInterfaceClosed:
bFinished = true;
break;
}
}
while (!bFinished);
deTest.Close();
this.dmTest.Close();
Is this perhaps a known behaviour? Or do i have to call some other method/property to force the twain driver window to be shown as a modal dialog?
Thank you.
Best regards
Daniel