Open GoogleCodeExporter opened 8 years ago
when i scanning on Cannon lide 110 pendingTransfer.Count alway return 0, i
can't continue scan next page
do
{
pendingTransfer.Count = 0;
IntPtr hbitmap = IntPtr.Zero;
// Get the image info
ImageInfo imageInfo = new ImageInfo();
result = Twain32Native.DsImageInfo(
ApplicationId,
DataSource.SourceId,
DataGroup.Image,
DataArgumentType.ImageInfo,
Message.Get,
imageInfo);
if (result != TwainResult.Success)
{
DataSource.Close();
break;
}
// Transfer the image from the device
result = Twain32Native.DsImageTransfer(
ApplicationId,
DataSource.SourceId,
DataGroup.Image,
DataArgumentType.ImageNativeXfer,
Message.Get,
ref hbitmap);
if (result != TwainResult.XferDone)
{
DataSource.Close();
break;
}
// End pending transfers
result = Twain32Native.DsPendingTransfer(
ApplicationId,
DataSource.SourceId,
DataGroup.Control,
DataArgumentType.PendingXfers,
Message.EndXfer,
pendingTransfer);
if (result != TwainResult.Success)
{
DataSource.Close();
break;
}
if (hbitmap == IntPtr.Zero)
{
log.Warn("Transfer complete but bitmap pointer is still null.");
}
else
{
using (var renderer = new BitmapRenderer(hbitmap))
{
TransferImageEventArgs args = new TransferImageEventArgs(renderer.RenderToBitmap(), pendingTransfer.Count != 0);
TransferImage(this, args);
if (!args.ContinueScanning)
break;
}
}
}
while (pendingTransfer.Count != 0);
Original comment by ledin...@gmail.com
on 13 Nov 2012 at 7:21
Original issue reported on code.google.com by
ledin...@gmail.com
on 13 Nov 2012 at 7:11