Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, August 31, 2009 1:39:47 AM(UTC)
sudhakar

Groups: Registered
Posts: 2


1 page in b/w
2 page in gray scale ( will have photo)
3 page onwards b/w

how to do so in vb.net
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, August 31, 2009 6:22:44 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 355


If you're using our .NET classes, the code will be like this:
Sub SetTransferCount(ByVal nPages As Integer)
   Dim twCap As TwainCapability = New TwainCapability()
   twCap.Information.ContainerType = TwainContainerType.OneValue
   twCap.OneValueCapability.ItemType = TwainItemType.Int16
   twCap.Information.Type = TwainCapabilityType.TransferCount
   twCap.OneValueCapability.Value = nPages
   acq_session.SetCapability(twCap, TwainSetCapabilityMode.Set)
End Sub

Sub SetPixelType(ByVal PixType As Leadtools.Twain.TwainCapabilityValue)
   Dim twCap As TwainCapability = New TwainCapability()
   twCap.Information.Type = TwainCapabilityType.ImagePixelType
   twCap.Information.ContainerType = TwainContainerType.OneValue
   twCap.OneValueCapability.ItemType = TwainItemType.Uint16
   twCap.OneValueCapability.Value = CType(PixType, Object)
   acq_session.SetCapability(twCap, TwainSetCapabilityMode.Set)
End Sub

Sub DifferentPixelTypes()
   acq_session = New TwainSession()
   acq_session.Startup(Me, "LEAD Technologies, Inc.", "LEAD Twain .NET", "Version 14", "LEADTools Twain test sample", TwainStartupFlags.None)
   acq_session.SelectSource(String.Empty)
   AddHandler acq_session.AcquirePage, AddressOf twain_AcquirePage

   SetPixelType(Leadtools.Twain.TwainCapabilityValue.PixelTypeBW)
   SetTransferCount(1)
   acq_session.Acquire(TwainUserInterfaceFlags.None)

   SetPixelType(Leadtools.Twain.TwainCapabilityValue.PixelTypeGray)
   SetTransferCount(2)
   acq_session.Acquire(TwainUserInterfaceFlags.None)

   SetPixelType(Leadtools.Twain.TwainCapabilityValue.PixelTypeBW)
   SetTransferCount(3)
   acq_session.Acquire(TwainUserInterfaceFlags.None)

   acq_session.Shutdown()
End Sub


Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.123 seconds.