• GdPicture.NET使用教程:一维条码的绘制


    GdPicture.NET是一款功能全面且可无限分发的文档图像处理的一体化工具包。其一体化主要包含:PDF、图像处理、文档影像、扫描、条形码、打印、OCR、表单处理、注释等。本文将简单介绍如何用GdPicture.NET实现一维条码的绘制。

    '假设GdPicture.NET已安装和解锁
    '假设创建并绘制了GdViewer对象GdViewer1
    Dim oGdPictureImaging As New GdPictureImaging
    '加载图片
    Dim imageId As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("C:\Image.tif")
    '检验图片是否被正确加载
    If imageId = 0 Then
    MessageBox.Show("Image Could Not Be Loaded! " + oGdPictureImaging.GetStat().ToString())
    Else
    '在GdViewer中显示图像
    GdViewer1.DisplayFromGdPictureImage(imageId)
    End If
    
    
    ''' <summary>
    ''' 在GdViewer的Mouse UP 事件中,绘制1D条码
    ''' </summary>
    ''' <param name=" eventSender ">对象
    ''' <param name=" eventArgs ">数据
    ''' <remarks>
    ''' 如果GdViewer没有矩形,则这个事件将什么都不会完成
    ''' </remarks>
    Public Sub Draw_Barcode(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles GdViewer1.MouseUp
    '初始化变量保存矩形位置
    Dim leftArea As Integer, topArea As Integer, widthArea As Integer, heightArea As Integer
    '检查GdViewer中是否画出矩形
    If GdViewer1.IsRect() Then
    '获取位置
    Call GdViewer1.GetRectCoordinatesOnDocument(leftArea, topArea, widthArea, heightArea)
    
    Dim barcodeType As Barcode1DWriterType = Barcode1DWriterType.Barcode1DWriterCode128
    '绘制1D条码
    Dim status As GdPictureStatus = oGdPictureImaging.Barcode1DWrite(imageId, barcodeType, "GdPicture 1D Barcode", leftArea, topArea, widthArea, heightArea, oGdPictureImaging.ARGB(255, 0, 0, 0))
    If status <> GdPictureStatus.OK Then
    MessageBox.Show("ERROR: " + status.ToString())
    Else
    '重绘该图像
    GdViewer1.Redraw()
    End If
    End If
    End Sub

    本文译自GdPicture.NET

    产品详情evget.com/product/1947

  • 相关阅读:
    electron—Chromium有酒,Node有肉
    .NET 应用程序运行提示"!!0[] System.Array.Empty()找不到方法"的解决办法
    安装.Net Framework 4.6.2时出现“无法建立到信任根颁发机构的证书链”解决方法
    Electron入门
    npm使用淘宝镜像安装包
    MySQL Unable to convert MySQL date/time value to System.DateTime的解决办法
    axios无法在ie9,10,11环境下运行的问题解决
    解决ini-parser解析ini文件中文乱码问题
    git的tag,branch操作
    java类加载器
  • 原文地址:https://www.cnblogs.com/jp294936239/p/5038831.html
Copyright © 2020-2023  润新知