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

Asks to the opened source to enable or disable the duplex scanning mode.

C#
public Boolean TwainEnableDuplex(
    Boolean Duplex
);
Visual Basic
Public Function TwainEnableDuplex(
    ByVal Duplex As Boolean
) As Boolean
Parameters
Parameters 
Description 
Duplex 
Set True to enable duplex mode else False.  
Returns

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

Before using this function check that the TWAIN state is >= 4 (TWAIN_SOURCE_OPEN). 

To get the back of the acquired image, just another time an acquisition function. 

To get the TWAIN state, use the TwainGetState() function.

Dim oGdPictureImaging As New GdPictureImaging
Dim ImageSide1 As Integer, ImageSide2 As Integer
 
oGdPictureImaging.SetLicenseNumber("XXX") 'Replace XXX by a demo or commercial license key
 
oGdPictureImaging.TwainSelectSource(Me.Handle)
oGdPictureImaging.TwainOpenDefaultSource(Me.Handle)
If oGdPictureImaging.TwainEnableDuplex(True) Then
   ImageSide1 = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
   oGdPictureImaging.SaveAsTIFF(ImageSide1, "side1.tif", TiffCompression.TiffCompressionAUTO)
   oGdPictureImaging.ReleaseGdPictureImage(ImageSide1)
   ImageSide2 = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
   oGdPictureImaging.SaveAsTIFF(ImageSide2, "side2.tif", TiffCompression.TiffCompressionAUTO)
   oGdPictureImaging.ReleaseGdPictureImage(ImageSide2)
Else
    MsgBox("Duplex Scanning mode is not supported!")
End If
oGdPictureImaging.TwainCloseSource()
What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.