VintaSoft Barcode .NET SDK v12.0 for .NET Framework
Vintasoft.Barcode.SymbologySubsets Namespace / Code39ExtendedBarcodeSymbology Class
Members Example




In This Topic
    Code39ExtendedBarcodeSymbology Class
    In This Topic
    Defines the Code39 Extended barcode symbology - subset of Code 39 barcode symbology.
    Object Model
    Code39ExtendedBarcodeSymbology ClassBarcodeSymbologySubset Class
    Syntax
    'Declaration
     
    Public Class Code39ExtendedBarcodeSymbology 
       Inherits BarcodeSymbologySubset
    'Usage
     
    Dim instance As Code39ExtendedBarcodeSymbology
    public class Code39ExtendedBarcodeSymbology : BarcodeSymbologySubset 
    public __gc class Code39ExtendedBarcodeSymbology : public BarcodeSymbologySubset 
    public ref class Code39ExtendedBarcodeSymbology : public BarcodeSymbologySubset 
    Example
    This example shows how to generate or recognize Code39 Extended barcode.
    ''' <summary>   
    ''' Generates the image of Code 39 Extended barcode with specified value.   
    ''' </summary>   
    Public Shared Function Generate(value As String) As Image   
    	' create barcode writer   
    	Dim writer As New BarcodeWriter()   
       
    	' encode Code39 Extended value   
    	BarcodeSymbologySubsets.Code39Extended.Encode(value, writer.Settings)   
       
    	' create barcode image   
    	Return writer.GetBarcodeAsBitmap()   
    End Function   
       
    ''' <summary>   
    ''' Recognizes the Code 39 Extended barcode on specified image.   
    ''' </summary>   
    Public Shared Sub Recognize(image As Image)   
    	' create the barcode reader   
    	Using reader As New BarcodeReader()   
    		' specify that reader must search for Code39 Extended barcodes only   
       
    		reader.Settings.ScanBarcodeTypes = BarcodeType.None   
    		reader.Settings.ScanBarcodeSubsets.Add(BarcodeSymbologySubsets.Code39Extended)   
       
    		' recognize barcode on image    
    		Dim infos As IBarcodeInfo() = reader.ReadBarcodes(image)   
       
    		' for each found barcode   
    		For j As Integer = 0 To infos.Length - 1   
    			Dim info As BarcodeSubsetInfo = DirectCast(infos(j), BarcodeSubsetInfo)   
       
    			' print  value   
    			Console.WriteLine(String.Format("{0} value: {1}", info.BarcodeSubset, info.Value))   
    		Next   
    	End Using   
    End Sub
    /// <summary>
    /// Generates the image of Code 39 Extended barcode with specified value.
    /// </summary>
    public static Image Generate(string value)
    {
        // create barcode writer
        BarcodeWriter writer = new BarcodeWriter();
        
        // encode Code39 Extended value
        BarcodeSymbologySubsets.Code39Extended.Encode(value, writer.Settings);
        
        // create barcode image
        return writer.GetBarcodeAsBitmap();
    }
                
    /// <summary>
    /// Recognizes the Code 39 Extended barcode on specified image.
    /// </summary>
    public static void Recognize(Image image)
    {
        // create the barcode reader
        using (BarcodeReader reader = new BarcodeReader())
        {
            // specify that reader must search for Code39 Extended barcodes only
                
            reader.Settings.ScanBarcodeTypes = BarcodeType.None;
            reader.Settings.ScanBarcodeSubsets.Add(BarcodeSymbologySubsets.Code39Extended);
                
            // recognize barcode on image 
            IBarcodeInfo[] infos = reader.ReadBarcodes(image);
                
            // for each found barcode
            for (int j = 0; j < infos.Length; j++)
            {
                BarcodeSubsetInfo info = (BarcodeSubsetInfo)infos[j];
                
                // print  value
                Console.WriteLine(string.Format("{0} value: {1}", info.BarcodeSubset, info.Value));
            }
        }
    }
    Inheritance Hierarchy

    System.Object
       Vintasoft.Barcode.SymbologySubsets.BarcodeSymbologySubset
          Vintasoft.Barcode.SymbologySubsets.Code39ExtendedBarcodeSymbology

    Requirements

    Target Platforms: .NET Framework 2.0, 3.0, 3.5, 4.x

    See Also