liuyuqi-dellpc 4 years ago
commit
a5217ac8e6

+ 20 - 0
ZebraSample.sln

@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZebraSample", "ZebraSample\ZebraSample.csproj", "{C7062FDB-1313-42D2-9E2D-6C6CACE2787A}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{C7062FDB-1313-42D2-9E2D-6C6CACE2787A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{C7062FDB-1313-42D2-9E2D-6C6CACE2787A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{C7062FDB-1313-42D2-9E2D-6C6CACE2787A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{C7062FDB-1313-42D2-9E2D-6C6CACE2787A}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 470 - 0
ZebraSample/Form1.Designer.cs

@@ -0,0 +1,470 @@
+namespace ZebraSample
+{
+    partial class Form1
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.txtTextWidth = new System.Windows.Forms.TextBox();
+            this.txtTextHeight = new System.Windows.Forms.TextBox();
+            this.txtBcY = new System.Windows.Forms.TextBox();
+            this.txtStartY = new System.Windows.Forms.TextBox();
+            this.txtStartX = new System.Windows.Forms.TextBox();
+            this.txtBcX = new System.Windows.Forms.TextBox();
+            this.txtBcHeight = new System.Windows.Forms.TextBox();
+            this.cbRatio = new System.Windows.Forms.ComboBox();
+            this.cbwidth = new System.Windows.Forms.ComboBox();
+            this.coBoxND = new System.Windows.Forms.ComboBox();
+            this.cmbImage = new System.Windows.Forms.ComboBox();
+            this.cbMagnification = new System.Windows.Forms.ComboBox();
+            this.coBoxSD = new System.Windows.Forms.ComboBox();
+            this.label23 = new System.Windows.Forms.Label();
+            this.label22 = new System.Windows.Forms.Label();
+            this.label10 = new System.Windows.Forms.Label();
+            this.label16 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.label19 = new System.Windows.Forms.Label();
+            this.label28 = new System.Windows.Forms.Label();
+            this.label15 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label18 = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.label21 = new System.Windows.Forms.Label();
+            this.label27 = new System.Windows.Forms.Label();
+            this.label14 = new System.Windows.Forms.Label();
+            this.label12 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.button1 = new System.Windows.Forms.Button();
+            this.groupBox1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.AutoSize = true;
+            this.groupBox1.Controls.Add(this.txtTextWidth);
+            this.groupBox1.Controls.Add(this.txtTextHeight);
+            this.groupBox1.Controls.Add(this.txtBcY);
+            this.groupBox1.Controls.Add(this.txtStartY);
+            this.groupBox1.Controls.Add(this.txtStartX);
+            this.groupBox1.Controls.Add(this.txtBcX);
+            this.groupBox1.Controls.Add(this.txtBcHeight);
+            this.groupBox1.Controls.Add(this.cbRatio);
+            this.groupBox1.Controls.Add(this.cbwidth);
+            this.groupBox1.Controls.Add(this.coBoxND);
+            this.groupBox1.Controls.Add(this.cmbImage);
+            this.groupBox1.Controls.Add(this.cbMagnification);
+            this.groupBox1.Controls.Add(this.coBoxSD);
+            this.groupBox1.Controls.Add(this.label23);
+            this.groupBox1.Controls.Add(this.label22);
+            this.groupBox1.Controls.Add(this.label10);
+            this.groupBox1.Controls.Add(this.label16);
+            this.groupBox1.Controls.Add(this.label9);
+            this.groupBox1.Controls.Add(this.label19);
+            this.groupBox1.Controls.Add(this.label28);
+            this.groupBox1.Controls.Add(this.label15);
+            this.groupBox1.Controls.Add(this.label8);
+            this.groupBox1.Controls.Add(this.label18);
+            this.groupBox1.Controls.Add(this.label13);
+            this.groupBox1.Controls.Add(this.label6);
+            this.groupBox1.Controls.Add(this.label21);
+            this.groupBox1.Controls.Add(this.label27);
+            this.groupBox1.Controls.Add(this.label14);
+            this.groupBox1.Controls.Add(this.label12);
+            this.groupBox1.Controls.Add(this.label7);
+            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.groupBox1.Location = new System.Drawing.Point(0, 0);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(560, 134);
+            this.groupBox1.TabIndex = 18;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "详细设置";
+            // 
+            // txtTextWidth
+            // 
+            this.txtTextWidth.Location = new System.Drawing.Point(196, 69);
+            this.txtTextWidth.Name = "txtTextWidth";
+            this.txtTextWidth.Size = new System.Drawing.Size(60, 21);
+            this.txtTextWidth.TabIndex = 90;
+            this.txtTextWidth.Text = "0";
+            // 
+            // txtTextHeight
+            // 
+            this.txtTextHeight.Location = new System.Drawing.Point(96, 69);
+            this.txtTextHeight.Name = "txtTextHeight";
+            this.txtTextHeight.Size = new System.Drawing.Size(60, 21);
+            this.txtTextHeight.TabIndex = 89;
+            this.txtTextHeight.Text = "0";
+            // 
+            // txtBcY
+            // 
+            this.txtBcY.Location = new System.Drawing.Point(196, 40);
+            this.txtBcY.Name = "txtBcY";
+            this.txtBcY.Size = new System.Drawing.Size(60, 21);
+            this.txtBcY.TabIndex = 85;
+            this.txtBcY.Text = "0";
+            // 
+            // txtStartY
+            // 
+            this.txtStartY.Location = new System.Drawing.Point(196, 15);
+            this.txtStartY.Name = "txtStartY";
+            this.txtStartY.Size = new System.Drawing.Size(60, 21);
+            this.txtStartY.TabIndex = 81;
+            this.txtStartY.Text = "0";
+            // 
+            // txtStartX
+            // 
+            this.txtStartX.Location = new System.Drawing.Point(96, 15);
+            this.txtStartX.Name = "txtStartX";
+            this.txtStartX.Size = new System.Drawing.Size(60, 21);
+            this.txtStartX.TabIndex = 80;
+            this.txtStartX.Text = "0";
+            // 
+            // txtBcX
+            // 
+            this.txtBcX.Location = new System.Drawing.Point(96, 40);
+            this.txtBcX.Name = "txtBcX";
+            this.txtBcX.Size = new System.Drawing.Size(60, 21);
+            this.txtBcX.TabIndex = 84;
+            this.txtBcX.Text = "0";
+            // 
+            // txtBcHeight
+            // 
+            this.txtBcHeight.Location = new System.Drawing.Point(293, 40);
+            this.txtBcHeight.Name = "txtBcHeight";
+            this.txtBcHeight.Size = new System.Drawing.Size(60, 21);
+            this.txtBcHeight.TabIndex = 86;
+            this.txtBcHeight.Text = "0";
+            // 
+            // cbRatio
+            // 
+            this.cbRatio.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cbRatio.FormattingEnabled = true;
+            this.cbRatio.Location = new System.Drawing.Point(479, 40);
+            this.cbRatio.Name = "cbRatio";
+            this.cbRatio.Size = new System.Drawing.Size(60, 20);
+            this.cbRatio.TabIndex = 88;
+            // 
+            // cbwidth
+            // 
+            this.cbwidth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cbwidth.FormattingEnabled = true;
+            this.cbwidth.Location = new System.Drawing.Point(395, 40);
+            this.cbwidth.Name = "cbwidth";
+            this.cbwidth.Size = new System.Drawing.Size(60, 20);
+            this.cbwidth.TabIndex = 87;
+            // 
+            // coBoxND
+            // 
+            this.coBoxND.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.coBoxND.FormattingEnabled = true;
+            this.coBoxND.Location = new System.Drawing.Point(395, 16);
+            this.coBoxND.Name = "coBoxND";
+            this.coBoxND.Size = new System.Drawing.Size(60, 20);
+            this.coBoxND.TabIndex = 83;
+            // 
+            // cmbImage
+            // 
+            this.cmbImage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cmbImage.FormattingEnabled = true;
+            this.cmbImage.Items.AddRange(new object[] {
+            "8010",
+            "8110"});
+            this.cmbImage.Location = new System.Drawing.Point(96, 94);
+            this.cmbImage.Name = "cmbImage";
+            this.cmbImage.Size = new System.Drawing.Size(60, 20);
+            this.cmbImage.TabIndex = 91;
+            // 
+            // cbMagnification
+            // 
+            this.cbMagnification.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cbMagnification.FormattingEnabled = true;
+            this.cbMagnification.Location = new System.Drawing.Point(196, 94);
+            this.cbMagnification.Name = "cbMagnification";
+            this.cbMagnification.Size = new System.Drawing.Size(60, 20);
+            this.cbMagnification.TabIndex = 91;
+            // 
+            // coBoxSD
+            // 
+            this.coBoxSD.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.coBoxSD.FormattingEnabled = true;
+            this.coBoxSD.Location = new System.Drawing.Point(293, 16);
+            this.coBoxSD.Name = "coBoxSD";
+            this.coBoxSD.Size = new System.Drawing.Size(60, 20);
+            this.coBoxSD.TabIndex = 82;
+            // 
+            // label23
+            // 
+            this.label23.AutoSize = true;
+            this.label23.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label23.ForeColor = System.Drawing.Color.Red;
+            this.label23.Location = new System.Drawing.Point(463, 45);
+            this.label23.Name = "label23";
+            this.label23.Size = new System.Drawing.Size(12, 12);
+            this.label23.TabIndex = 22;
+            this.label23.Text = "R";
+            // 
+            // label22
+            // 
+            this.label22.AutoSize = true;
+            this.label22.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label22.ForeColor = System.Drawing.Color.Red;
+            this.label22.Location = new System.Drawing.Point(376, 45);
+            this.label22.Name = "label22";
+            this.label22.Size = new System.Drawing.Size(12, 12);
+            this.label22.TabIndex = 22;
+            this.label22.Text = "W";
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label10.ForeColor = System.Drawing.Color.Red;
+            this.label10.Location = new System.Drawing.Point(361, 20);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(31, 12);
+            this.label10.TabIndex = 22;
+            this.label10.Text = "浓度";
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label16.ForeColor = System.Drawing.Color.Red;
+            this.label16.Location = new System.Drawing.Point(160, 72);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(31, 12);
+            this.label16.TabIndex = 19;
+            this.label16.Text = "宽度";
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.ForeColor = System.Drawing.Color.Red;
+            this.label9.Location = new System.Drawing.Point(261, 20);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(31, 12);
+            this.label9.TabIndex = 21;
+            this.label9.Text = "速度";
+            // 
+            // label19
+            // 
+            this.label19.AutoSize = true;
+            this.label19.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label19.ForeColor = System.Drawing.Color.Red;
+            this.label19.Location = new System.Drawing.Point(181, 45);
+            this.label19.Name = "label19";
+            this.label19.Size = new System.Drawing.Size(12, 12);
+            this.label19.TabIndex = 20;
+            this.label19.Text = "Y";
+            // 
+            // label28
+            // 
+            this.label28.AutoSize = true;
+            this.label28.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label28.ForeColor = System.Drawing.Color.Red;
+            this.label28.Location = new System.Drawing.Point(65, 97);
+            this.label28.Name = "label28";
+            this.label28.Size = new System.Drawing.Size(31, 12);
+            this.label28.TabIndex = 19;
+            this.label28.Text = "型号";
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label15.ForeColor = System.Drawing.Color.Red;
+            this.label15.Location = new System.Drawing.Point(64, 72);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(31, 12);
+            this.label15.TabIndex = 19;
+            this.label15.Text = "高度";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label8.ForeColor = System.Drawing.Color.Red;
+            this.label8.Location = new System.Drawing.Point(181, 20);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(12, 12);
+            this.label8.TabIndex = 20;
+            this.label8.Text = "Y";
+            // 
+            // label18
+            // 
+            this.label18.AutoSize = true;
+            this.label18.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label18.ForeColor = System.Drawing.Color.Red;
+            this.label18.Location = new System.Drawing.Point(83, 45);
+            this.label18.Name = "label18";
+            this.label18.Size = new System.Drawing.Size(12, 12);
+            this.label18.TabIndex = 19;
+            this.label18.Text = "X";
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label13.ForeColor = System.Drawing.Color.Red;
+            this.label13.Location = new System.Drawing.Point(261, 45);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(31, 12);
+            this.label13.TabIndex = 19;
+            this.label13.Text = "高度";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label6.ForeColor = System.Drawing.Color.Red;
+            this.label6.Location = new System.Drawing.Point(83, 20);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(12, 12);
+            this.label6.TabIndex = 19;
+            this.label6.Text = "X";
+            // 
+            // label21
+            // 
+            this.label21.AutoSize = true;
+            this.label21.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label21.ForeColor = System.Drawing.Color.Red;
+            this.label21.Location = new System.Drawing.Point(160, 97);
+            this.label21.Name = "label21";
+            this.label21.Size = new System.Drawing.Size(31, 12);
+            this.label21.TabIndex = 16;
+            this.label21.Text = "倍数";
+            // 
+            // label27
+            // 
+            this.label27.AutoSize = true;
+            this.label27.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label27.ForeColor = System.Drawing.Color.Blue;
+            this.label27.Location = new System.Drawing.Point(4, 97);
+            this.label27.Name = "label27";
+            this.label27.Size = new System.Drawing.Size(57, 12);
+            this.label27.TabIndex = 16;
+            this.label27.Text = "图盘设置";
+            // 
+            // label14
+            // 
+            this.label14.AutoSize = true;
+            this.label14.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label14.ForeColor = System.Drawing.Color.Blue;
+            this.label14.Location = new System.Drawing.Point(6, 72);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(57, 12);
+            this.label14.TabIndex = 16;
+            this.label14.Text = "文字设置";
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label12.ForeColor = System.Drawing.Color.Blue;
+            this.label12.Location = new System.Drawing.Point(6, 45);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(57, 12);
+            this.label12.TabIndex = 16;
+            this.label12.Text = "条码设置";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label7.ForeColor = System.Drawing.Color.Blue;
+            this.label7.Location = new System.Drawing.Point(6, 19);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(57, 12);
+            this.label7.TabIndex = 16;
+            this.label7.Text = "初始位置";
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(6, 141);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.TabIndex = 19;
+            this.button1.Text = "测试";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(560, 450);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.groupBox1);
+            this.Name = "Form1";
+            this.Text = "Form1";
+            this.Load += new System.EventHandler(this.Form1_Load);
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.TextBox txtTextWidth;
+        private System.Windows.Forms.TextBox txtTextHeight;
+        private System.Windows.Forms.TextBox txtBcY;
+        private System.Windows.Forms.TextBox txtStartY;
+        private System.Windows.Forms.TextBox txtStartX;
+        private System.Windows.Forms.TextBox txtBcX;
+        private System.Windows.Forms.TextBox txtBcHeight;
+        private System.Windows.Forms.ComboBox cbRatio;
+        private System.Windows.Forms.ComboBox cbwidth;
+        private System.Windows.Forms.ComboBox coBoxND;
+        private System.Windows.Forms.ComboBox cmbImage;
+        private System.Windows.Forms.ComboBox cbMagnification;
+        private System.Windows.Forms.ComboBox coBoxSD;
+        private System.Windows.Forms.Label label23;
+        private System.Windows.Forms.Label label22;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label label19;
+        private System.Windows.Forms.Label label28;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label label18;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label label21;
+        private System.Windows.Forms.Label label27;
+        private System.Windows.Forms.Label label14;
+        private System.Windows.Forms.Label label12;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Button button1;
+    }
+}
+

+ 221 - 0
ZebraSample/Form1.cs

@@ -0,0 +1,221 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace ZebraSample
+{
+    public partial class Form1 : Form
+    {
+        public Form1()
+        {
+            InitializeComponent();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            PrintLabel("12345", "ABCDEFGHIJK", "SN123", "Test");
+        }
+
+        public void PrintLabel(string ProductID, string MAC, string SN, string ProductDesc)
+        {
+            string strContenx1 = ProductID;
+            string strContenx2 = MAC;
+            string strContenx3 = SN;
+
+
+            //全局参数
+            int GlobalStartX = int.Parse(txtStartX.Text);
+            int GlobalStartY = int.Parse(txtStartY.Text);
+            int Deep = int.Parse(coBoxND.SelectedValue.ToString());
+            int Quatity = 15;
+            int Speed = int.Parse(coBoxSD.SelectedValue.ToString());
+
+            //条码参数
+            int BcStartX = int.Parse(txtBcX.Text);
+            int BcStartY = int.Parse(txtBcY.Text);
+            int BcHeight = int.Parse(txtBcHeight.Text);
+            int BcW = int.Parse(cbwidth.SelectedValue.ToString());
+            double BcR = double.Parse(cbRatio.SelectedValue.ToString());
+
+
+            //文字参数
+            int intTextH = int.Parse(txtTextHeight.Text);
+            int intTextW = int.Parse(txtTextWidth.Text);
+
+
+            List<GetPrintRowString> bcList = new List<GetPrintRowString>(); ;
+
+            //第一个条码
+            Barcode1Dimension bc1 = new Barcode1Dimension(BcStartX, BcStartY);
+            bc1.bcContent = strContenx1;//填充打印内容
+            bc1.bcSize = BcHeight;//填充条码大小
+            bc1.bcW = BcW;
+            bc1.bcR = BcR;
+            bcList.Add(bc1);
+
+            //第二个条码
+            Barcode1Dimension bc2 = new Barcode1Dimension(BcStartX, BcStartY + (BcHeight + intTextH + 10));
+
+            bc2.bcContent = strContenx2.Split('-')[0]; ;//填充打印内容
+            bc2.bcSize = BcHeight;//填充条码大小
+            bc2.bcW = BcW;
+            bc2.bcR = BcR;
+            bcList.Add(bc2);
+
+            //第三个条码
+            Barcode1Dimension bc3 = new Barcode1Dimension(BcStartX, BcStartY + (BcHeight + intTextH + 10) * 2);
+            bc3.bcContent = strContenx3;//填充打印内容
+            bc3.bcSize = BcHeight;//填充条码大小
+            bc3.bcW = BcW;
+            bc3.bcR = BcR;
+            bcList.Add(bc3);
+
+            //第一个文本
+            Text text1 = new Text(BcStartX, BcStartY + BcHeight + 5);
+            text1.txtContent = "PROD ID:" + strContenx1  + "      " + ProductDesc;//填充打印内容
+            text1.txtH = intTextH;
+            text1.txtW = intTextW;
+            bcList.Add(text1);
+
+            //第二个文本
+            Text text2 = new Text(BcStartX, BcStartY + (BcHeight + intTextH + 10) + BcHeight + 5);
+            text2.txtContent = "MAC:" + strContenx2;//填充打印内容
+            text2.txtH = intTextH;
+            text2.txtW = intTextW;
+            bcList.Add(text2);
+
+            //第三个文本
+            Text text3 = new Text(BcStartX, BcStartY + (BcHeight + intTextH + 10) * 2 + BcHeight + 5);
+            text3.txtContent = "SN:" + strContenx3;//填充打印内容
+            text3.txtH = intTextH;
+            text3.txtW = intTextW;
+            bcList.Add(text3);
+
+
+            ////图片
+            //Images imgPrint = new Images(10, 10);
+            //imgPrint.imgName = cmbImage.SelectedItem.ToString(); ;
+            //imgPrint.imgMX = int.Parse(cbMagnification.SelectedValue.ToString());
+            //imgPrint.imgMY = int.Parse(cbMagnification.SelectedValue.ToString());
+            //bcList.Add(imgPrint);
+
+            GetPrintString model = new GetPrintString();
+            model.Deep = Deep;
+            model.Quatity = Quatity;
+            model.Speed = Speed;
+            model.StartX = GlobalStartX;
+            model.StartY = GlobalStartY;
+            model.list = bcList;
+            //model.imgPath = cmbImage.SelectedItem.ToString() + ".GRF";
+            model.Print();
+        }
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+            FillDataND();
+            FillDataSD();
+            FillMagnification();
+            FillRatio();
+            FillWidth();
+        }
+        private void FillDataND() //浓度
+        {
+            DataTable dt = new DataTable();
+            dt.Columns.Add("code", typeof(string));
+            DataRow dr;
+            for (int i = 1; i <= 30; i++)
+            {
+                dr = dt.NewRow();
+                dr["code"] = i.ToString();
+                dt.Rows.Add(dr);
+            }
+            this.coBoxND.DataSource = dt;
+            this.coBoxND.DisplayMember = "code";
+            this.coBoxND.ValueMember = "code";
+
+        }
+
+        private void FillMagnification() //图片倍数
+        {
+            DataTable dt = new DataTable();
+            dt.Columns.Add("code", typeof(string));
+            DataRow dr;
+            for (int i = 1; i <= 10; i++)
+            {
+                dr = dt.NewRow();
+                dr["code"] = i.ToString();
+                dt.Rows.Add(dr);
+            }
+            this.cbMagnification.DataSource = dt;
+            this.cbMagnification.DisplayMember = "code";
+            this.cbMagnification.ValueMember = "code";
+
+        }
+
+        private void FillWidth() //W
+        {
+            DataTable dt = new DataTable();
+            dt.Columns.Add("code", typeof(string));
+            DataRow dr;
+            for (int i = 1; i <= 10; i++)
+            {
+                dr = dt.NewRow();
+                dr["code"] = i.ToString();
+                dt.Rows.Add(dr);
+            }
+            this.cbwidth.DataSource = dt;
+            this.cbwidth.DisplayMember = "code";
+            this.cbwidth.ValueMember = "code";
+
+        }
+
+        private void FillRatio() //R
+        {
+            DataTable dt = new DataTable();
+            dt.Columns.Add("code", typeof(double));
+            DataRow dr;
+            double douSeed = 2.0;
+            for (int i = 1; i <= 11; i++)
+            {
+                dr = dt.NewRow();
+                dr["code"] = douSeed.ToString();
+                dt.Rows.Add(dr);
+                douSeed = douSeed + 0.1;
+            }
+            this.cbRatio.DataSource = dt;
+            this.cbRatio.DisplayMember = "code";
+            this.cbRatio.ValueMember = "code";
+
+        }
+
+        private void FillDataSD() //速度
+        {
+            DataTable dt = new DataTable();
+            dt.Columns.Add("code", typeof(string));
+            dt.Columns.Add("name", typeof(string));
+            DataRow dr = dt.NewRow();
+            dr["code"] = "1";
+            dr["name"] = "1英寸/每秒";
+            dt.Rows.Add(dr);
+
+            dr = dt.NewRow();
+            dr["code"] = "2";
+            dr["name"] = "2英寸/每秒";
+            dt.Rows.Add(dr);
+
+            dr = dt.NewRow();
+            dr["code"] = "3";
+            dr["name"] = "3英寸/每秒";
+            dt.Rows.Add(dr);
+
+            this.coBoxSD.DataSource = dt;
+            this.coBoxSD.DisplayMember = "name";
+            this.coBoxSD.ValueMember = "code";
+
+        }
+    }
+}

+ 120 - 0
ZebraSample/Form1.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 168 - 0
ZebraSample/GetPrintRowString.cs

@@ -0,0 +1,168 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ZebraSample
+{
+    public abstract class GetPrintRowString
+    {
+        protected int X = 0;
+        protected int Y = 0;
+
+        public GetPrintRowString()
+        {
+
+        }
+
+        public GetPrintRowString(int X, int Y)
+        {
+            this.X = X;
+            this.Y = Y;
+        }
+
+        public abstract string PrintString();
+    }
+    /// <summary>
+    /// 一维条码
+    /// </summary>
+    public class Barcode1Dimension : GetPrintRowString
+    {
+        public Barcode1Dimension()
+            : base()
+        {
+
+        }
+        public Barcode1Dimension(int X, int Y)
+            : base(X, Y)
+        {
+
+        }
+
+        string _bcContent;
+        int _bcSize;
+        int _bcW;
+        double _bcR;
+
+        public string bcContent
+        {
+            set { _bcContent = value; }
+            get { return _bcContent; }
+        }
+
+        public int bcSize
+        {
+            set { _bcSize = value; }
+            get { return _bcSize; }
+        }
+
+        public int bcW
+        {
+            set { _bcW = value; }
+            get { return _bcW; }
+        }
+
+        public double bcR
+        {
+            set { _bcR = value; }
+            get { return _bcR; }
+        }
+
+
+        public override string PrintString()
+        {
+            return "^FO" + base.X + "," + base.Y + "^BY" + bcW + "," + bcR + "^BCN," + bcSize + ",N,N,N^FD" + bcContent + "^FS\r\n";//打印条码
+        }
+    }
+
+    /// <summary>
+    /// 文本
+    /// </summary>
+    public class Text : GetPrintRowString
+    {
+        public Text()
+            : base()
+        {
+
+        }
+        public Text(int X, int Y)
+            : base(X, Y)
+        {
+
+        }
+
+        string _txtContent;
+        int _txtW;
+        int _txtH;
+
+        public string txtContent
+        {
+            set { _txtContent = value; }
+            get { return _txtContent; }
+        }
+
+        public int txtW
+        {
+            set { _txtW = value; }
+            get { return _txtW; }
+        }
+
+        public int txtH
+        {
+            set { _txtH = value; }
+            get { return _txtH; }
+        }
+
+
+        public override string PrintString()
+        {
+            return "^FO" + base.X + "," + base.Y + "^ADN," + txtH + "," + txtW + "^CI0^FD" + txtContent + "^FS\r\n";
+        }
+    }
+
+    /// <summary>
+    /// 图片
+    /// </summary>
+    public class Images : GetPrintRowString
+    {
+        public Images()
+            : base()
+        {
+
+        }
+        public Images(int X, int Y)
+            : base(X, Y)
+        {
+
+        }
+
+        string _imgName;
+        int _imgMX;//x放大
+        int _imgMY;//y放大
+
+
+        public string imgName
+        {
+            set { _imgName = value; }
+            get { return _imgName; }
+        }
+
+
+        public int imgMX
+        {
+            set { _imgMX = value; }
+            get { return _imgMX; }
+        }
+
+        public int imgMY
+        {
+            set { _imgMY = value; }
+            get { return _imgMY; }
+        }
+
+
+        public override string PrintString()
+        {
+            return "^FO" + base.X + "," + base.Y + "^XG" + imgName + "," + imgMX + "," + imgMY + "^FS\r\n";
+        }
+    }
+}

+ 88 - 0
ZebraSample/GetPrintString.cs

@@ -0,0 +1,88 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ZebraSample
+{
+    class GetPrintString
+    {
+        int _Speed;
+        int _Deep;
+        int _Quatity;
+        int _StartX;
+        int _StartY;
+        string _imgPath;
+
+        public int Speed
+        {
+            set { _Speed = value; }
+            get { return _Speed; }
+        }
+
+        public int Deep
+        {
+            set { _Deep = value; }
+            get { return _Deep; }
+        }
+
+        public int Quatity
+        {
+            set { _Quatity = value; }
+            get { return _Quatity; }
+        }
+
+        public int StartX
+        {
+            set { _StartX = value; }
+            get { return _StartX; }
+        }
+
+        public int StartY
+        {
+            set { _StartY = value; }
+            get { return _StartY; }
+        }
+
+        public string imgPath
+        {
+            set { _imgPath = value; }
+            get { return _imgPath; }
+        }
+
+        //数据子项
+        List<GetPrintRowString> _list;
+        public List<GetPrintRowString> list
+        {
+            set { _list = value; }
+            get { return _list; }
+        }
+
+
+        public void Print()
+        {
+            StringBuilder str = new StringBuilder();
+            //str.Append(System.IO.File.ReadAllText(imgPath));
+            //打印命令开始
+            str.Append("^XA \r\n");
+            str.Append("^LH" + StartX.ToString() + "," + StartY.ToString() + "\r\n");//起始位置
+            str.Append("^PR" + Speed.ToString() + "\r\n");//打印速度
+            str.Append("^MD" + Deep.ToString() + "\r\n");//打印浓度
+            //获取需要打印的条码list
+            foreach (GetPrintRowString bc in list)
+            {
+                str.Append(bc.PrintString());
+            }
+            str.Append("^XZ");//结束打印
+            LPTControls lpt = new LPTControls();
+
+            //将打印命令保存到文本,print.txt里写了条码机的命令
+            System.IO.File.WriteAllText("print.txt", str.ToString());//print.txt里写了条码机的命令
+
+            //使用LPT端口打印
+            lpt.Open();
+            lpt.Write(str.ToString());
+            lpt.Close();
+
+        }
+    }
+}

+ 64 - 0
ZebraSample/LPTControls.cs

@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace ZebraSample
+{
+    public class LPTControls
+    {
+        [StructLayout(LayoutKind.Sequential)]
+        private struct OVERLAPPED
+        {
+            int Internal;
+            int InternalHigh;
+            int Offset;
+            int OffSetHigh;
+            int hEvent;
+        }
+        [DllImport("kernel32.dll")]
+        private static extern int CreateFile(string lpFileName, uint dwDesiredAccess, int dwShareMode, int lpSecurityAttributes, int dwCreationDisposition, int dwFlagsAndAttributes, int hTemplateFile);
+
+        [DllImport("kernel32.dll")]
+        private static extern bool WriteFile(int hFile, byte[] lpBuffer, int nNumberOfBytesToWriter, out int lpNumberOfBytesWriten, out OVERLAPPED lpOverLapped);
+
+        [DllImport("kernel32.dll")]
+        private static extern bool CloseHandle(int hObject);
+
+        private int iHandle;
+
+        //打开LPT 端口
+        public bool Open()
+        {
+            iHandle = CreateFile("lpt1", 0x40000000, 0, 0, 3, 0, 0);
+            if (iHandle != -1)
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+        //打印函数,参数为打印机的命令或者其他文本!
+        public bool Write(string MyString)
+        {
+            if (iHandle != 1)
+            {
+                int i;
+                OVERLAPPED x;
+                byte[] mybyte = System.Text.Encoding.Default.GetBytes(MyString);
+                return WriteFile(iHandle, mybyte, mybyte.Length, out i, out x);
+            }
+            else
+            {
+                throw new Exception("端口未打开~!");
+            }
+        }
+        //关闭打印端口
+        public bool Close()
+        {
+            return CloseHandle(iHandle);
+        }
+    }
+}

BIN
ZebraSample/LptPrint.dll


+ 20 - 0
ZebraSample/Program.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace ZebraSample
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+    }
+}

+ 33 - 0
ZebraSample/Properties/AssemblyInfo.cs

@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过下列属性集
+// 控制。更改这些属性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("ZebraSample")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("SZ")]
+[assembly: AssemblyProduct("ZebraSample")]
+[assembly: AssemblyCopyright("版权所有 (C) SZ 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 属性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("9eecf0cf-0df1-400a-a901-8203c30d7218")]
+
+// 程序集的版本信息由下面四个值组成:
+//
+//      主版本
+//      次版本 
+//      内部版本号
+//      修订号
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71 - 0
ZebraSample/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由一个工具生成。
+//     运行库版本:2.0.50727.3634
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace ZebraSample.Properties
+{
+
+
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   返回此类使用的、缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ZebraSample.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   为所有资源查找重写当前线程的 CurrentUICulture 属性,
+        ///   方法是使用此强类型资源类。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
ZebraSample/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+	<!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+	<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+		<xsd:element name="root" msdata:IsDataSet="true">
+			<xsd:complexType>
+				<xsd:choice maxOccurs="unbounded">
+					<xsd:element name="metadata">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" />
+							<xsd:attribute name="type" type="xsd:string" />
+							<xsd:attribute name="mimetype" type="xsd:string" />
+						</xsd:complexType>
+					</xsd:element>
+					<xsd:element name="assembly">
+						<xsd:complexType>
+							<xsd:attribute name="alias" type="xsd:string" />
+							<xsd:attribute name="name" type="xsd:string" />
+						</xsd:complexType>
+					</xsd:element>
+					<xsd:element name="data">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+								<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+							<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+							<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+						</xsd:complexType>
+					</xsd:element>
+					<xsd:element name="resheader">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" use="required" />
+						</xsd:complexType>
+					</xsd:element>
+				</xsd:choice>
+			</xsd:complexType>
+		</xsd:element>
+	</xsd:schema>
+	<resheader name="resmimetype">
+		<value>text/microsoft-resx</value>
+	</resheader>
+	<resheader name="version">
+		<value>2.0</value>
+	</resheader>
+	<resheader name="reader">
+		<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+	<resheader name="writer">
+		<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+</root>

+ 30 - 0
ZebraSample/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.3634
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace ZebraSample.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
ZebraSample/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 84 - 0
ZebraSample/ZebraSample.csproj

@@ -0,0 +1,84 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.50727</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{C7062FDB-1313-42D2-9E2D-6C6CACE2787A}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>ZebraSample</RootNamespace>
+    <AssemblyName>ZebraSample</AssemblyName>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="GetPrintRowString.cs" />
+    <Compile Include="GetPrintString.cs" />
+    <Compile Include="LPTControls.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Form1.resx">
+      <SubType>Designer</SubType>
+      <DependentUpon>Form1.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="LptPrint.dll" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>