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

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

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

引入dll

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

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

兩種方法:

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

或者通過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)論

全南县| 中山市| 丽水市| 清镇市| 临猗县| 张家川| 全南县| 沅江市| 澄迈县| 宜君县| 龙胜| 赣榆县| 巍山| 安溪县| 天津市| 四川省| 顺昌县| 克拉玛依市| 恩平市| 灌云县| 麟游县| 遂川县| 海阳市| 上犹县| 白水县| 阿克苏市| 汽车| 黄大仙区| 东兰县| 定陶县| 瓦房店市| 恩施市| 库伦旗| 高陵县| 栾城县| 镇远县| 耿马| 杨浦区| 石门县| 云阳县| 凌海市|