• 大小: 326KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-12-25
  • 语言: C#
  • 标签: 条形码  

资源简介

EAN-13条形码生成的 C#源码

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
//下载源码到51aspx
namespace BarCodeTest
{
    public partial class MainTest : Form
    {
        public MainTest()
        {
            InitializeComponent();
        }
        CodeLib.Barcode b = new CodeLib.Barcode();
        private void groupBox1_Enter(object sender EventArgs e)
        {

        }

        private void MainTest_Load(object sender EventArgs e)
        {
            Bitmap temp = new Bitmap(1 1);
            temp.SetPixel(0 0 this.BackColor);
            barcode.Image = (Image)temp;
            this.cbEncodeType.SelectedIndex = 0;
            this.cbBarcodeAlign.SelectedIndex = 0;
            this.cbLabelLocation.SelectedIndex = 0;

            this.cbRotateFlip.DataSource = System.Enum.GetNames(typeof(RotateFlipType));

            int i = 0;
            foreach (object o in cbRotateFlip.Items)
            {
                if (o.ToString().Trim().ToLower() == “rotatenoneflipnone“)
                    break;
                i++;
            }//foreach
            this.cbRotateFlip.SelectedIndex = i;

            //Show library version
            this.btnBackColor.BackColor = this.b.BackColor;
            this.btnForeColor.BackColor = this.b.ForeColor;
        }

        private void btnEncode_Click(object sender EventArgs e)
        {
            errorProvider1.Clear();
            int W = Convert.ToInt32(this.txtWidth.Text.Trim());
            int H = Convert.ToInt32(this.txtHeight.Text.Trim());
            CodeLib.AlignmentPositions Align = CodeLib.AlignmentPositions.CENTER;

            //barcode alignment
            switch (cbBarcodeAlign.SelectedItem.ToString().Trim().ToLower())
            {
                case “left“: Align = CodeLib.AlignmentPositions.LEFT; break;
                case “right“: Align = CodeLib.AlignmentPositions.RIGHT; break;
                default: Align = CodeLib.AlignmentPositions.CENTER; break;
            }//switch

            CodeLib.TYPE type = CodeLib.TYPE.UNSPECIFIED;
            switch (cbEncodeType.SelectedItem.ToString().Trim())
            {
                case “UPC-A“: type = CodeLib.TYPE.UPCA; break;
                case “UPC-E“: type = CodeLib.TYPE.UPCE; break;
                case “UPC 2 Digit Ext.“: type = CodeLib.TYPE.UPC_SUPPLEMENTAL_2DIGIT; break;
                case “UPC 5 Digit Ext.“: type = CodeLib.TYPE.UPC_SUPPLEMENTAL_5DIGIT; break;
                case “EAN-13“: type = CodeLib.TYPE.EAN13; break;
                case “JAN-13“: type = CodeLib.TYPE.JAN13; break;
                case “EAN-8“: type = CodeLib.TYPE.EAN8; break;
                case “ITF-14“: type = CodeLib.TYPE.ITF14; break;
                case “Codabar“: type = CodeLib.TYPE.Codabar; break;
                case “PostNet“: type = CodeLib.TYPE.PostNet; break;
           

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

     文件       1864  2011-03-22 14:14  条形码生成源码\51aspx源码必读.txt

     文件       3802  2011-02-11 14:33  条形码生成源码\BarCodeTest\BarCodeTest.csproj

     文件      49152  2011-02-11 14:44  条形码生成源码\BarCodeTest\bin\Debug\BarCodeTest.exe

     文件      48640  2011-02-11 14:44  条形码生成源码\BarCodeTest\bin\Debug\BarCodeTest.pdb

     文件       5632  2005-12-09 14:38  条形码生成源码\BarCodeTest\bin\Debug\BarCodeTest.vshost.exe

     文件     122880  2011-02-11 14:25  条形码生成源码\BarCodeTest\bin\Debug\CodeLib.dll

     文件     187904  2011-02-11 14:25  条形码生成源码\BarCodeTest\bin\Debug\CodeLib.pdb

     文件      16068  2011-03-22 14:14  条形码生成源码\BarCodeTest\MainTest.cs

     文件      23853  2011-02-11 14:40  条形码生成源码\BarCodeTest\MainTest.Designer.cs

     文件       6215  2011-02-11 14:40  条形码生成源码\BarCodeTest\MainTest.resx

     文件        969  2011-02-11 14:44  条形码生成源码\BarCodeTest\obj\BarCodeTest.csproj.FileListAbsolute.txt

     文件        905  2011-02-11 14:40  条形码生成源码\BarCodeTest\obj\Debug\BarCodeTest.csproj.GenerateResource.Cache

     文件      49152  2011-02-11 14:44  条形码生成源码\BarCodeTest\obj\Debug\BarCodeTest.exe

     文件        180  2011-02-11 14:40  条形码生成源码\BarCodeTest\obj\Debug\BarCodeTest.MainTest.resources

     文件      48640  2011-02-11 14:44  条形码生成源码\BarCodeTest\obj\Debug\BarCodeTest.pdb

     文件        180  2011-02-11 14:25  条形码生成源码\BarCodeTest\obj\Debug\BarCodeTest.Properties.Resources.resources

     文件       1644  2011-02-11 14:25  条形码生成源码\BarCodeTest\obj\Debug\BarCodeTest.TestApp.resources

     文件       5071  2011-02-11 14:25  条形码生成源码\BarCodeTest\obj\Debug\ResolveAssemblyReference.cache

     文件        476  2011-02-11 14:55  条形码生成源码\BarCodeTest\Program.cs

     文件       1197  2011-02-11 14:22  条形码生成源码\BarCodeTest\Properties\AssemblyInfo.cs

     文件       2908  2011-02-11 14:22  条形码生成源码\BarCodeTest\Properties\Resources.Designer.cs

     文件       5612  2011-02-11 14:22  条形码生成源码\BarCodeTest\Properties\Resources.resx

     文件       1096  2011-02-11 14:22  条形码生成源码\BarCodeTest\Properties\Settings.Designer.cs

     文件        249  2011-02-11 14:22  条形码生成源码\BarCodeTest\Properties\Settings.settings

     文件      16896  2011-02-11 14:25  条形码生成源码\BarCodeTest\TestApp.cs

     文件      26235  2011-02-11 14:24  条形码生成源码\BarCodeTest\TestApp.designer.cs

     文件       8306  2011-02-11 14:23  条形码生成源码\BarCodeTest\TestApp.resx

     文件       1397  2011-02-11 14:22  条形码生成源码\BarCode_2D.sln

     文件       1336  2011-02-11 14:21  条形码生成源码\CodeLib\BarcodeCommon.cs

     文件      46905  2011-03-22 14:14  条形码生成源码\CodeLib\BarcodeLib.cs

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

评论

共有 条评论