Leadtools.Twain Namespace > TwainSession Class : AcquireToImage Method |
public RasterImage AcquireToImage( TwainUserInterfaceFlags flags )
'Declaration Public Function AcquireToImage( _ ByVal flags As TwainUserInterfaceFlags _ ) As RasterImage
'Usage Dim instance As TwainSession Dim flags As TwainUserInterfaceFlags Dim value As RasterImage value = instance.AcquireToImage(flags)
public RasterImage AcquireToImage( TwainUserInterfaceFlags flags )
function Leadtools.Twain.TwainSession.AcquireToImage( flags )
public: RasterImage^ AcquireToImage( TwainUserInterfaceFlags flags )
Public Sub AcquireToImageExample(ByVal parent As IWin32Window) Dim session As TwainSession = New TwainSession() session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None) Dim twCap As TwainCapability = New TwainCapability() twCap.Information.Type = TwainCapabilityType.ImageTransferMechanism twCap.Information.ContainerType = TwainContainerType.OneValue twCap.OneValueCapability.ItemType = TwainItemType.Uint16 twCap.OneValueCapability.Value = TwainCapabilityValue.TransferMechanismNative session.SetCapability(twCap, TwainSetCapabilityMode.Set) Dim img As RasterImage = session.AcquireToImage(TwainUserInterfaceFlags.Show) ' ' save the acquired image here... ' session.Shutdown() End Sub
public void AcquireToImageExample(IWin32Window parent) { TwainSession session = new TwainSession(); session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); TwainCapability twCap = new TwainCapability(); twCap.Information.Type = TwainCapabilityType.ImageTransferMechanism; twCap.Information.ContainerType = TwainContainerType.OneValue; twCap.OneValueCapability.ItemType = TwainItemType.Uint16; twCap.OneValueCapability.Value = TwainCapabilityValue.TransferMechanismNative; session.SetCapability(twCap, TwainSetCapabilityMode.Set); RasterImage img = session.AcquireToImage(TwainUserInterfaceFlags.Show); // // save the acquired image here... // session.Shutdown(); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2