Recognize and generate DotCode barcodes using VintaSoft Barcode .NET SDK
July 10, 2025
![]() |
![]() |
![]() |
![]() |
/// <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(); } } } }
/// <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); } }
/// <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(); } }