←Select platform

GetAllDefaultOptions Method

Summary
Gets a list of all the current barcode read options.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public BarcodeReadOptions[] GetAllDefaultOptions() 
@property (nonatomic, strong, readonly) NSArray<__kindof LTBarcodeReadOptions *> *allDefaultOptions; 
public BarcodeReadOptions[] getAllDefaultOptions() 
public: 
array<BarcodeReadOptions^>^ GetAllDefaultOptions();  
def GetAllDefaultOptions(self): 

Return Value

An array of BarcodeReadOptions derived types that contain all the default read options currently set in this BarcodeReader.

Remarks

The BarcodeReader object contains an array of all the default read options used by the ReadBarcode and ReadBarcodes methods when no explicit options are passed by the user.

Refer to the BarcodeReadOptions class for a list of the symbologies and the type of the derived BarcodeReadOptions used by LEADTOOLS.

To get the options for a specific symbology, refer to GetDefaultOptions

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Barcode; 
using Leadtools.ImageProcessing; 
 
 
public void BarcodeReader_GetAllDefaultOptionsExample() 
{ 
   BarcodeEngine engine = new BarcodeEngine(); 
   BarcodeReader reader = engine.Reader; 
 
   // Show information on all the default read option classes 
   BarcodeReadOptions[] readOptionsArray = reader.GetAllDefaultOptions(); 
   Console.WriteLine("Read options:"); 
   foreach (BarcodeReadOptions readOptions in readOptionsArray) 
   { 
      Console.WriteLine("  {0} ({1}) supports options for the following symbologies:", readOptions.GetType().Name, readOptions.FriendlyName); 
      Console.WriteLine("     "); 
      BarcodeSymbology[] symbologies = readOptions.GetSupportedSymbologies(); 
      for (int i = 0; i < symbologies.Length; i++) 
      { 
         Console.Write(symbologies[i]); 
         if (i != (symbologies.Length - 1)) 
         { 
            Console.Write(", "); 
         } 
         else 
         { 
            Console.WriteLine(); 
         } 
      } 
   } 
} 
 
import java.io.File; 
import java.io.IOException; 
import java.util.*; 
import java.util.concurrent.ExecutorService; 
import java.util.concurrent.Executors; 
 
import org.junit.*; 
import org.junit.Test; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.*; 
 
import leadtools.*; 
import leadtools.barcode.*; 
import leadtools.codecs.*; 
import leadtools.imageprocessing.*; 
import leadtools.internal.ManualResetEvent; 
 
 
public void barcodeReaderGetAllDefaultOptionsExample() { 
   BarcodeEngine engine = new BarcodeEngine(); 
   BarcodeReader reader = engine.getReader(); 
 
   // Show information on all the default read option classes 
   BarcodeReadOptions[] readOptionsArray = reader.getAllDefaultOptions(); 
   System.out.println("Read options:"); 
 
   int k = 0; 
   for (BarcodeReadOptions readOptions : readOptionsArray) { 
      k++; 
      System.out.printf("  %1s (%2s) supports options for the following symbologies:%n", 
            readOptions.getClass().getTypeName(), readOptions.getFriendlyName()); 
      System.out.println("     "); 
      BarcodeSymbology[] symbologies = readOptions.getSupportedSymbologies(); 
 
      for (int i = 0; i < symbologies.length; i++) { 
         System.out.print(symbologies[i]); 
         if (i != (symbologies.length - 1)) { 
            System.out.print(", "); 
         } else { 
            System.out.println(); 
         } 
      } 
   } 
 
   assertTrue("Not all expected readOptions are present", k == readOptionsArray.length); 
   System.out.println("All readOptions have been accounted for"); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Barcode Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.