最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

C#/VB.NET讀取條碼類型及條碼在圖片中的坐標(biāo)位置實(shí)例

 更新時(shí)間:2023年10月20日 09:49:17   作者:E-iceblue  
我們?cè)趧?chuàng)建條形碼時(shí),如果以圖片的方式將創(chuàng)建好的條碼保存到指定文件夾路徑,可以在程序中直接加載圖片使用;已生成的條碼圖片,需要通過(guò)讀取圖片中的條碼信息,如條碼類型、條碼繪制區(qū)域在圖片中的四個(gè)頂點(diǎn)坐標(biāo)位置等,可參考本文中的方法

引入dll

:讀取時(shí),也支持讀取二維碼類型。

調(diào)用API:Spire.Barcode for .NET

兩種方法:

★1. 在VS中通過(guò)“管理NuGet包”,搜索“Spire.Barcode”安裝;

或者通過(guò)PM控制臺(tái)安裝:

PM> NuGet\Install-Package Spire.Barcode -Version 6.8.0

★2. 官網(wǎng)下載包,安裝到本地路徑,然后將安裝路徑下的Spire.Barcode.dll手動(dòng)引入到VS程序。

讀取條碼類型及頂點(diǎn)坐標(biāo)

C#

using Spire.Barcode;
using Spire.Barcode.Settings;
using System.Drawing;
namespace GetBarcode
{
    class Program
    {
        static void Main(string[] args)
        {
            //加載條碼圖片
            BarcodeInfo[] barcodeInfos = BarcodeScanner.ScanInfo("img.png");
            for (int i = 0; i < barcodeInfos.Length; i++)
            {
                //獲取條碼類型
                BarCodeReadType barCodeReadType = barcodeInfos[i].BarCodeReadType;
                System.Console.WriteLine("Barcode Type is:" + barCodeReadType.ToString());           
                //獲取條形碼圖片中的四個(gè)頂點(diǎn)坐標(biāo)位置
                Point[] vertexes = barcodeInfos[i].Vertexes;
                //輸出結(jié)果
                for(int j = 0; j < vertexes.Length; j++)
                {
                    System.Console.WriteLine(vertexes[j]);
                }               
                System.Console.ReadKey();
            }
        }
    }
}

VB.NET

Imports Spire.Barcode
Imports Spire.Barcode.Settings
Imports System.Drawing
Namespace GetBarcode
    Class Program
        Private Shared Sub Main(args As String())
            '加載條碼圖片
            Dim barcodeInfos As BarcodeInfo() = BarcodeScanner.ScanInfo("img.png")
            For i As Integer = 0 To barcodeInfos.Length - 1
                '獲取條碼類型
                Dim barCodeReadType As BarCodeReadType = barcodeInfos(i).BarCodeReadType
                System.Console.WriteLine("Barcode Type is:" + barCodeReadType.ToString())
                '獲取條形碼圖片中的四個(gè)頂點(diǎn)坐標(biāo)位置
                Dim vertexes As Point() = barcodeInfos(i).Vertexes
                '輸出結(jié)果
                For j As Integer = 0 To vertexes.Length - 1
                    System.Console.WriteLine(vertexes(j))
                Next
                System.Console.ReadKey()
            Next
        End Sub
    End Class
End Namespace

讀取結(jié)果

以上就是C#/VB.NET讀取條碼類型及條碼在圖片中的坐標(biāo)位置實(shí)現(xiàn)的詳細(xì)內(nèi)容,更多關(guān)于C#/VB.NET讀取條碼類型坐標(biāo)位置 的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評(píng)論

温州市| 双桥区| 谷城县| 周口市| 剑川县| 墨江| 九江市| 洛扎县| 乌拉特后旗| 大余县| 天峨县| 龙州县| 鄄城县| 高淳县| 朔州市| 来宾市| 秭归县| 阜南县| 柏乡县| 安岳县| 厦门市| 南皮县| 博湖县| 扬州市| 巴马| 信丰县| 三江| 弋阳县| 琼中| 铜山县| 定陶县| 察隅县| 界首市| 明溪县| 织金县| 吕梁市| 定陶县| 巨野县| 漯河市| 团风县| 双峰县|