VintaSoft Barcode .NET SDK を使用して DotCode バーコードを認識および生成します。

ブログ カテゴリ: バーコード.NET

2025/07/10

VintaSoft Barcode .NET SDK は、Windows、Linux、macOS 用の専門的なクロスプラットフォーム SDK であり、.NET、WPF、Web、MAUI で DotCode バーコードを認識および生成できます。 DotCode バーコードを認識および生成する機能を .NET アプリケーションに追加するには、数行のコードだけが必要です。


DotCodeバーコードとは?

DotCodeは、高速インクジェットまたはレーザードット技術を用いて印刷された際に確実に読み取れるよう設​​計された2次元マトリックスバーコードです。このバーコードを使用することで、製造日、有効期限、シリアル番号などの動的なデータを生産ラインの速度で製品に付与することができます。 DotCode バーコードの特徴は、目に見える固定パターンが存在せず、マトリックス ドットが「チェッカーボード」順に配置されていることです。


DotCode バーコードの特徴

DotCode バーコードは、DotCode Rev 4 の現在のバージョンを説明する 2019 年の AIM 標準によって定義されています。

DotCode バーコードは、次の 3 つのエンコード モードで無制限の量の混合データを保存できます。

Support for the GS1 standard allows you to encode data in GS1 format (BarcodeSymbologySubsets.GS1DotCode).

DotCode バーコードは、破損したバーコードを認識できるリード ソロモン エラー訂正アルゴリズムを使用します。

DotCodeバーコードは、以下の特殊文字をエンコードできます。


マトリックス構造

DotCodeマトリックスは正方形または長方形にすることができ、様々な用途に合わせてアスペクト比を柔軟に調整できます。最小シンボルサイズは非常に小さく(最大3x3 mm)、タバコの箱や医薬品などの小型アイテムのマーキングに最適です。



VintaSoft Barcode .NET SDK は、ラスターまたはベクター イメージとして DotCode バーコードを生成することができるほか、高速バーコード印刷を実行できる MatrixBarcodeStructure も生成できます。


VintaSoft Barcode .NET SDKはどのようなDotCodeを認識できますか?

VintaSoft Barcode .NET SDK は、DotCode バーコードを認識するときに、さまざまな問題のあるバーコードをすばやく認識できる独自のアルゴリズムを使用します。



カメラでキャプチャした画像内の DotCode バーコードを認識する方法を示す C# コードは次のとおりです。
/// <summary>
/// Reads DotCode barcodes from a <see cref="System.Drawing.Bitmap"/>.
/// </summary>
/// <param name="bitmap">A bitmap with barcodes.</param>
public static void ReadDotCodeBarcodesFromBitmap(System.Drawing.Bitmap bitmap)
{
    // create barcode reader
    using (Vintasoft.Barcode.BarcodeReader reader = new Vintasoft.Barcode.BarcodeReader())
    {
        // specify that reader must search for DotCode barcodes
        reader.Settings.ScanBarcodeTypes = Vintasoft.Barcode.BarcodeType.DotCode;

        // read barcodes from image
        Vintasoft.Barcode.IBarcodeInfo[] infos = Vintasoft.Barcode.GdiExtensions.ReadBarcodes(reader, bitmap);

        // if barcodes are not detected
        if (infos.Length == 0)
        {
            System.Console.WriteLine("No barcodes found.");
        }
        // if barcodes are detected
        else
        {
            // get information about extracted barcodes

            System.Console.WriteLine(string.Format("{0} barcodes found:", infos.Length));
            System.Console.WriteLine();
            for (int i = 0; i < infos.Length; i++)
            {
                Vintasoft.Barcode.IBarcodeInfo info = infos[i];
                System.Console.WriteLine(string.Format("[{0}:{1}]", i + 1, info.BarcodeType));
                System.Console.WriteLine(string.Format("Value:      {0}", info.Value));
                System.Console.WriteLine(string.Format("Region:     {0}", info.Region));
                System.Console.WriteLine();
            }
        }
    }
}


VintaSoft Barcode .NET SDK はどのような DotCode バーコードを生成できますか?

VintaSoft Barcode .NET SDK は、すべての種類の DotCode バーコードを生成します。

DotCode バーコード ビットマップの生成方法を示す C# コードは次のとおりです。
/// <summary>
/// Returns the DotCode barcode as <see cref="System.Drawing.Bitmap"/>.
/// </summary>
/// <param name="value">The barcode value.</param>
/// <returns>A <see cref="System.Drawing.Bitmap"/> object.</returns>
public static System.Drawing.Bitmap GetDotCodeBarcodeAsBitmap(string value)
{
    // create the barcode writer
    using (Vintasoft.Barcode.BarcodeWriter barcodeWriter = new Vintasoft.Barcode.BarcodeWriter())
    {
        // set barcode writer settings
        barcodeWriter.Settings.Barcode = Vintasoft.Barcode.BarcodeType.DotCode;
        barcodeWriter.Settings.Value = value;

        // get a barcode image as System.Drawing.Bitmap
        return Vintasoft.Barcode.GdiExtensions.GetBarcodeAsBitmap(barcodeWriter);
    }
}


DotCode バーコードのベクター (SVG) イメージの生成方法を示す C# コードは次のとおりです。
/// <summary>
/// Returns the DotCode barcode in vector form as a SVG string.
/// </summary>
/// <param name="barcodeValue">Barcode value.</param>
public static void GetDotCodeBarcodeAsSvgString(string barcodeValue)
{
    // create the barcode writer
    using (Vintasoft.Barcode.BarcodeWriter barcodeWriter = new Vintasoft.Barcode.BarcodeWriter())
    {
        // set barcode writer settings
        barcodeWriter.Settings.Barcode = Vintasoft.Barcode.BarcodeType.DotCode;
        barcodeWriter.Settings.Value = barcodeValue;

        // generate DotCode barcode as a SVG string
        return barcodeWriter.GetBarcodeAsSvgFile();
    }
}