GdPicture.NET Reference Guide
TwainGetCapCurrentString Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : TwainGetCapCurrentString Method
A member of the TwainCapabilities enumeration.
Returns the current value of the specified TWAIN capability.
Returns as string, the current value of a TWAIN capability.
Syntax
'Declaration
 
Public Function TwainGetCapCurrentString( _
   ByVal Cap As TwainCapabilities, _
   ByRef CurrentValue As String _
) As Boolean
public bool TwainGetCapCurrentString( 
   TwainCapabilities Cap,
   ref string CurrentValue
)
public function TwainGetCapCurrentString( 
    Cap: TwainCapabilities;
   var  CurrentValue: String
): Boolean; 
public function TwainGetCapCurrentString( 
   Cap : TwainCapabilities,
   CurrentValue : String
) : boolean;
public: bool TwainGetCapCurrentString( 
   TwainCapabilities Cap,
   ref string* CurrentValue
) 
public:
bool TwainGetCapCurrentString( 
   TwainCapabilities Cap,
   String^% CurrentValue
) 

Parameters

Cap
A member of the TwainCapabilities enumeration.
CurrentValue
Returns the current value of the specified TWAIN capability.

Return Value

True if success, else False -> Use TwainGetLastResultCode() and TwainGetLastConditionCode() methods for diagnosing the error.
Remarks
Before using this method check that the TWAIN state is >= 4 (TWAIN_SOURCE_OPEN) To get the TWAIN state, use the TwainGetState() method. This method can be used to retrieve the following types of capabilities: TWTY_STR32, TWTY_STR64, TWTY_STR128, TWTY_STR255 . You can determine the type of each TWAIN capability using the TwainGetCapItemType method or looking the twain references from http://www.twain.org
Example
Gets the current halftone pattern used by the default source
Dim CurrentCapValue As String=""
oGdPictureImaging.TwainOpenDefaultSource(Me.Handle)
oGdPictureImaging.TwainGetCapCurrentString(TwainCapabilities.ICAP_HALFTONES, CurrentCapValue)
MessageBox.Show("The current halftone pattern used: " + CurrentCapValue)
oGdPictureImaging.TwainCloseSource()
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
TwainGetCapItemType Method
TwainGetState Method
TwainSetCapCurrentString Method
TwainGetLastConditionCode Method
TwainGetLastResultCode Method