You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > TWAIN Features > TwainOpenSource Method
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.TwainOpenSource Method

Opens the source with the given name. 

If another source is open, closes it and attempts to open the specified source. 

First this function for each scanning process or to set the TWAIN state to 4 (TWAIN_SOURCE_OPEN) when the TWAIN state is 3 (TWAIN_SM_OPEN) or 2 (TWAIN_SM_LOADED) or 1 (TWAIN_PRESESSION).

C#
public Boolean TwainOpenSource(
    IntPtr HANDLE, 
    String SourceName
);
Visual Basic
Public Function TwainOpenSource(
    ByVal HANDLE As IntPtr, 
    ByVal SourceName As String
) As Boolean
Parameters
Parameters 
Description 
HANDLE 
A Window Handle IE: Me.Handle. In most applications you can use nothing but on Citrix and WTS, this must be a top-level window or a child of a top level window.  
SourceName 
The name of the source to open.  
Returns

True if success, else False -> Use TwainGetLastResultCode() and TwainGetLastConditionCode() functions for diagnosing the error.

If this returns TRUE, TWAIN is in STATE 4 (TWAIN_SOURCE_OPEN).

What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.