• 大小: 218KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-13
  • 语言: C#
  • 标签: C#  Graphics  ZXing  打印  

资源简介

采用C#代码,利用Graphics类库自动画表格填充变量值,以及ZXing类库产生条码,最终打印出来

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ZXing.Common;
using ZXing;
using ZXing.Rendering;
using System.Drawing.Drawing2D;
using System.Drawing;
using System.IO;

namespace BlueEngineSaleLabel
{
    public static  class clsGenerateCode
    {
        private static int _Height;
        private static int _With;

        public static int Height
        {
            get { return _Height; }
        }
        public static int With
        {
            get { return _With; }
        }

        public static Bitmap GenerateBarcode(string strBarcodeValue)
        {
           
                        //产生条码
                        EncodingOptions encodeOption = new EncodingOptions();
                        encodeOption.Height = 45;
                        encodeOption.Width = 150;
                        _Height = encodeOption.Height;
                        _With = encodeOption.Width;
                        encodeOption.Margin = 0;
                        encodeOption.PureBarcode = false;//是否在下方显示条码数字

                        ZXing.BarcodeWriter wr = new BarcodeWriter();
                        wr.Options.PureBarcode = true;
                        wr.Options = encodeOption;
                        wr.Format = BarcodeFormat.CODE_128;
                        Bitmap img = wr.Write(strBarcodeValue);

                        return img;
         }
    }
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1089  2017-06-21 16:47  BlueEngineSaleLabel\App.config

     文件      12800  2017-06-21 16:44  BlueEngineSaleLabel\bin\Debug\BlueEngineSaleLabel.exe

     文件       1089  2017-06-21 16:47  BlueEngineSaleLabel\bin\Debug\BlueEngineSaleLabel.exe.config

     文件      30208  2017-06-21 16:44  BlueEngineSaleLabel\bin\Debug\BlueEngineSaleLabel.pdb

     文件      22984  2017-06-23 23:25  BlueEngineSaleLabel\bin\Debug\BlueEngineSaleLabel.vshost.exe

     文件       1089  2017-06-21 16:47  BlueEngineSaleLabel\bin\Debug\BlueEngineSaleLabel.vshost.exe.config

     文件        490  2013-03-18 17:00  BlueEngineSaleLabel\bin\Debug\BlueEngineSaleLabel.vshost.exe.manifest

     文件     430080  2014-04-02 03:44  BlueEngineSaleLabel\bin\Debug\zxing.dll

     文件       4282  2017-06-21 16:44  BlueEngineSaleLabel\BlueEngineSaleLabel.csproj

     文件        927  2017-06-19 22:39  BlueEngineSaleLabel\BlueEngineSaleLabel.sln

    ..A..H.     49152  2017-06-23 10:36  BlueEngineSaleLabel\BlueEngineSaleLabel.v11.suo

     文件       1567  2017-06-23 10:21  BlueEngineSaleLabel\clsGenerateCode.cs

     文件       1136  2017-06-23 23:25  BlueEngineSaleLabel\obj\Debug\BlueEngineSaleLabel.csproj.FileListAbsolute.txt

     文件        984  2017-06-20 16:18  BlueEngineSaleLabel\obj\Debug\BlueEngineSaleLabel.csproj.GenerateResource.Cache

     文件       8043  2017-06-21 16:43  BlueEngineSaleLabel\obj\Debug\BlueEngineSaleLabel.csprojResolveAssemblyReference.cache

     文件      12800  2017-06-21 16:44  BlueEngineSaleLabel\obj\Debug\BlueEngineSaleLabel.exe

     文件      30208  2017-06-21 16:44  BlueEngineSaleLabel\obj\Debug\BlueEngineSaleLabel.pdb

     文件        180  2017-06-21 16:44  BlueEngineSaleLabel\obj\Debug\BlueEngineSaleLabel.PrintSaleOrder.resources

     文件        180  2017-06-21 16:44  BlueEngineSaleLabel\obj\Debug\BlueEngineSaleLabel.Properties.Resources.resources

     文件       1318  2017-06-20 01:18  BlueEngineSaleLabel\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7221  2017-06-23 09:34  BlueEngineSaleLabel\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2017-06-19 22:39  BlueEngineSaleLabel\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2017-06-19 22:39  BlueEngineSaleLabel\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2017-06-19 22:39  BlueEngineSaleLabel\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件       5733  2017-06-21 16:44  BlueEngineSaleLabel\PrintSaleOrder.cs

     文件       2758  2017-06-20 15:39  BlueEngineSaleLabel\PrintSaleOrder.Designer.cs

     文件       5817  2017-06-20 15:39  BlueEngineSaleLabel\PrintSaleOrder.resx

     文件        540  2017-06-19 22:47  BlueEngineSaleLabel\Program.cs

     文件       1376  2017-06-19 22:39  BlueEngineSaleLabel\Properties\AssemblyInfo.cs

     文件       2890  2017-06-19 22:39  BlueEngineSaleLabel\Properties\Resources.Designer.cs

............此处省略14个文件信息

评论

共有 条评论