Example





In This Topic
GdPicture14 Namespace / GdPictureOCR Class / ResetSelectedDictionaries Method

ResetSelectedDictionaries Method (GdPictureOCR)

In This Topic
Resets, means completely release, all previously added languages and dictionaries by the AddLanguage and the AddCustomDictionary methods.
Syntax
'Declaration
 
Public Function ResetSelectedDictionaries() As GdPictureStatus
public GdPictureStatus ResetSelectedDictionaries()
public function ResetSelectedDictionaries(): GdPictureStatus; 
public function ResetSelectedDictionaries() : GdPictureStatus;
public: GdPictureStatus ResetSelectedDictionaries(); 
public:
GdPictureStatus ResetSelectedDictionaries(); 

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Example
How to release already specified languages and dictionaries.
Dim caption As String = "Example: ResetSelectedDictionaries"
Using gdpictureOCR As GdPictureOCR = New GdPictureOCR()
    'Specify your resource folder for OCR dictionaries.
    gdpictureOCR.ResourcesFolder = "\GdPicture.Net 14\redist\OCR"
    'Reset previously added languages, if any.
    gdpictureOCR.ResetSelectedDictionaries()
    'Add only the french language.
    If gdpictureOCR.AddLanguage(OCRLanguage.French) = GdPictureStatus.OK Then
        'You can do your another stuff with gdpictureOCR here.
    Else
        MessageBox.Show("The AddLanguage() method has failed with the status: " + gdpictureOCR.GetStat().ToString(), caption)
    End If
End Using
string caption = "Example: ResetSelectedDictionaries";
using (GdPictureOCR gdpictureOCR = new GdPictureOCR())
{
    //Specify your resource folder for OCR dictionaries.
    gdpictureOCR.ResourcesFolder = "\\GdPicture.Net 14\\redist\\OCR";
 
    //Reset previously added languages, if any.
    gdpictureOCR.ResetSelectedDictionaries();
 
    //Add only the french language.
    if (gdpictureOCR.AddLanguage(OCRLanguage.French) == GdPictureStatus.OK)
    {
        //You can do your another stuff with gdpictureOCR here.
    }
    else
    {
        MessageBox.Show("The AddLanguage() method has failed with the status: " + gdpictureOCR.GetStat().ToString(), caption);
    }
}
See Also