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

Saves to a file current settings of the opened source, e.g. DPI, paper size, color format.

C#
public Boolean TwainSaveConfiguration(
    String FilePath
);
Visual Basic
Public Function TwainSaveConfiguration(
    ByVal FilePath As String
) As Boolean
Parameters
Parameters 
Description 
FilePath 
The file to save the current device configuration.  
Returns

TRUE if successful, FALSE otherwise -> Use TwainGetLastResultCode() and TwainGetLastConditionCode() functions for diagnosing the error.

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

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

Open device & save its current configuration from file

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim oGdPictureImaging As New GdPictureImaging
 
        oGdPictureImaging.SetLicenseNumber("XXX") 'Replace XXX by valid demo or commercial KEY
        If oGdPictureImaging.TwainOpenDefaultSource(Me.Handle) Then
            If Not oGdPictureImaging.TwainSaveConfiguration("config1.cdd") = True Then
                MsgBox("Can't save current configuration. This capability is probably unsupported by the TWAIN device")
            End If
        Else
            MsgBox("Can't open default source")
        End If
    End Sub
What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.