Commit ded2484b 贾鹏旭

1

1 个父辈 ef20a532
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
this.NumW = new System.Windows.Forms.NumericUpDown(); this.NumW = new System.Windows.Forms.NumericUpDown();
this.NumH = new System.Windows.Forms.NumericUpDown(); this.NumH = new System.Windows.Forms.NumericUpDown();
this.TxtFormatText = new System.Windows.Forms.TextBox(); this.TxtFormatText = new System.Windows.Forms.TextBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
...@@ -56,33 +55,38 @@ ...@@ -56,33 +55,38 @@
this.NumLabelH = new System.Windows.Forms.NumericUpDown(); this.NumLabelH = new System.Windows.Forms.NumericUpDown();
this.NumLabelW = new System.Windows.Forms.NumericUpDown(); this.NumLabelW = new System.Windows.Forms.NumericUpDown();
this.label_labelsize = new System.Windows.Forms.Label(); this.label_labelsize = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.NumX)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NumX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NumY)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NumY)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NumW)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NumW)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NumH)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NumH)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NumLabelH)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NumLabelH)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NumLabelW)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NumLabelW)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// LstLabelName // LstLabelName
// //
this.LstLabelName.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.LstLabelName.FormattingEnabled = true; this.LstLabelName.FormattingEnabled = true;
this.LstLabelName.IntegralHeight = false; this.LstLabelName.IntegralHeight = false;
this.LstLabelName.ItemHeight = 12; this.LstLabelName.ItemHeight = 12;
this.LstLabelName.Location = new System.Drawing.Point(12, 12); this.LstLabelName.Location = new System.Drawing.Point(13, 10);
this.LstLabelName.Margin = new System.Windows.Forms.Padding(4);
this.LstLabelName.Name = "LstLabelName"; this.LstLabelName.Name = "LstLabelName";
this.LstLabelName.Size = new System.Drawing.Size(179, 90); this.LstLabelName.Size = new System.Drawing.Size(145, 112);
this.LstLabelName.TabIndex = 0; this.LstLabelName.TabIndex = 0;
this.LstLabelName.SelectedIndexChanged += new System.EventHandler(this.LstLabelName_SelectedIndexChanged); this.LstLabelName.SelectedIndexChanged += new System.EventHandler(this.LstLabelName_SelectedIndexChanged);
// //
// BtnLabelNew // BtnLabelNew
// //
this.BtnLabelNew.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.BtnLabelNew.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.BtnLabelNew.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.BtnLabelNew.Location = new System.Drawing.Point(12, 108); this.BtnLabelNew.Location = new System.Drawing.Point(13, 134);
this.BtnLabelNew.Margin = new System.Windows.Forms.Padding(4);
this.BtnLabelNew.Name = "BtnLabelNew"; this.BtnLabelNew.Name = "BtnLabelNew";
this.BtnLabelNew.Size = new System.Drawing.Size(179, 26); this.BtnLabelNew.Size = new System.Drawing.Size(145, 32);
this.BtnLabelNew.TabIndex = 1; this.BtnLabelNew.TabIndex = 1;
this.BtnLabelNew.Text = "新建"; this.BtnLabelNew.Text = "新建";
this.BtnLabelNew.UseVisualStyleBackColor = true; this.BtnLabelNew.UseVisualStyleBackColor = true;
...@@ -90,10 +94,12 @@ ...@@ -90,10 +94,12 @@
// //
// BtnLabelDel // BtnLabelDel
// //
this.BtnLabelDel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.BtnLabelDel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.BtnLabelDel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.BtnLabelDel.Location = new System.Drawing.Point(106, 140); this.BtnLabelDel.Location = new System.Drawing.Point(92, 174);
this.BtnLabelDel.Margin = new System.Windows.Forms.Padding(4);
this.BtnLabelDel.Name = "BtnLabelDel"; this.BtnLabelDel.Name = "BtnLabelDel";
this.BtnLabelDel.Size = new System.Drawing.Size(85, 26); this.BtnLabelDel.Size = new System.Drawing.Size(66, 32);
this.BtnLabelDel.TabIndex = 2; this.BtnLabelDel.TabIndex = 2;
this.BtnLabelDel.Text = "删除"; this.BtnLabelDel.Text = "删除";
this.BtnLabelDel.UseVisualStyleBackColor = true; this.BtnLabelDel.UseVisualStyleBackColor = true;
...@@ -101,10 +107,12 @@ ...@@ -101,10 +107,12 @@
// //
// BtnRename // BtnRename
// //
this.BtnRename.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.BtnRename.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.BtnRename.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.BtnRename.Location = new System.Drawing.Point(12, 140); this.BtnRename.Location = new System.Drawing.Point(13, 175);
this.BtnRename.Margin = new System.Windows.Forms.Padding(4);
this.BtnRename.Name = "BtnRename"; this.BtnRename.Name = "BtnRename";
this.BtnRename.Size = new System.Drawing.Size(85, 26); this.BtnRename.Size = new System.Drawing.Size(71, 32);
this.BtnRename.TabIndex = 3; this.BtnRename.TabIndex = 3;
this.BtnRename.Text = "重命名"; this.BtnRename.Text = "重命名";
this.BtnRename.UseVisualStyleBackColor = true; this.BtnRename.UseVisualStyleBackColor = true;
...@@ -112,10 +120,12 @@ ...@@ -112,10 +120,12 @@
// //
// BtnPrintTest // BtnPrintTest
// //
this.BtnPrintTest.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.BtnPrintTest.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.BtnPrintTest.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.BtnPrintTest.Location = new System.Drawing.Point(12, 256); this.BtnPrintTest.Location = new System.Drawing.Point(13, 300);
this.BtnPrintTest.Margin = new System.Windows.Forms.Padding(4);
this.BtnPrintTest.Name = "BtnPrintTest"; this.BtnPrintTest.Name = "BtnPrintTest";
this.BtnPrintTest.Size = new System.Drawing.Size(179, 26); this.BtnPrintTest.Size = new System.Drawing.Size(145, 32);
this.BtnPrintTest.TabIndex = 4; this.BtnPrintTest.TabIndex = 4;
this.BtnPrintTest.Text = "打印测试"; this.BtnPrintTest.Text = "打印测试";
this.BtnPrintTest.UseVisualStyleBackColor = true; this.BtnPrintTest.UseVisualStyleBackColor = true;
...@@ -123,10 +133,12 @@ ...@@ -123,10 +133,12 @@
// //
// BtnSave // BtnSave
// //
this.BtnSave.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.BtnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.BtnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.BtnSave.Location = new System.Drawing.Point(12, 173); this.BtnSave.Location = new System.Drawing.Point(13, 222);
this.BtnSave.Margin = new System.Windows.Forms.Padding(4);
this.BtnSave.Name = "BtnSave"; this.BtnSave.Name = "BtnSave";
this.BtnSave.Size = new System.Drawing.Size(179, 26); this.BtnSave.Size = new System.Drawing.Size(145, 32);
this.BtnSave.TabIndex = 5; this.BtnSave.TabIndex = 5;
this.BtnSave.Text = "保存"; this.BtnSave.Text = "保存";
this.BtnSave.UseVisualStyleBackColor = true; this.BtnSave.UseVisualStyleBackColor = true;
...@@ -134,11 +146,12 @@ ...@@ -134,11 +146,12 @@
// //
// BtnFieldAdd // BtnFieldAdd
// //
this.BtnFieldAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.BtnFieldAdd.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.BtnFieldAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.BtnFieldAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.BtnFieldAdd.Location = new System.Drawing.Point(664, 14); this.BtnFieldAdd.Location = new System.Drawing.Point(747, 5);
this.BtnFieldAdd.Margin = new System.Windows.Forms.Padding(4);
this.BtnFieldAdd.Name = "BtnFieldAdd"; this.BtnFieldAdd.Name = "BtnFieldAdd";
this.BtnFieldAdd.Size = new System.Drawing.Size(85, 26); this.BtnFieldAdd.Size = new System.Drawing.Size(113, 32);
this.BtnFieldAdd.TabIndex = 6; this.BtnFieldAdd.TabIndex = 6;
this.BtnFieldAdd.Text = "字段添加"; this.BtnFieldAdd.Text = "字段添加";
this.BtnFieldAdd.UseVisualStyleBackColor = true; this.BtnFieldAdd.UseVisualStyleBackColor = true;
...@@ -146,11 +159,12 @@ ...@@ -146,11 +159,12 @@
// //
// BtnFieldDel // BtnFieldDel
// //
this.BtnFieldDel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.BtnFieldDel.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.BtnFieldDel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.BtnFieldDel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.BtnFieldDel.Location = new System.Drawing.Point(755, 14); this.BtnFieldDel.Location = new System.Drawing.Point(877, 56);
this.BtnFieldDel.Margin = new System.Windows.Forms.Padding(4);
this.BtnFieldDel.Name = "BtnFieldDel"; this.BtnFieldDel.Name = "BtnFieldDel";
this.BtnFieldDel.Size = new System.Drawing.Size(85, 26); this.BtnFieldDel.Size = new System.Drawing.Size(113, 32);
this.BtnFieldDel.TabIndex = 7; this.BtnFieldDel.TabIndex = 7;
this.BtnFieldDel.Text = "字段删除"; this.BtnFieldDel.Text = "字段删除";
this.BtnFieldDel.UseVisualStyleBackColor = true; this.BtnFieldDel.UseVisualStyleBackColor = true;
...@@ -158,11 +172,12 @@ ...@@ -158,11 +172,12 @@
// //
// BtnFieldFont // BtnFieldFont
// //
this.BtnFieldFont.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.BtnFieldFont.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.BtnFieldFont.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.BtnFieldFont.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.BtnFieldFont.Location = new System.Drawing.Point(664, 46); this.BtnFieldFont.Location = new System.Drawing.Point(877, 5);
this.BtnFieldFont.Margin = new System.Windows.Forms.Padding(4);
this.BtnFieldFont.Name = "BtnFieldFont"; this.BtnFieldFont.Name = "BtnFieldFont";
this.BtnFieldFont.Size = new System.Drawing.Size(85, 26); this.BtnFieldFont.Size = new System.Drawing.Size(113, 32);
this.BtnFieldFont.TabIndex = 8; this.BtnFieldFont.TabIndex = 8;
this.BtnFieldFont.Text = "字段字体"; this.BtnFieldFont.Text = "字段字体";
this.BtnFieldFont.UseVisualStyleBackColor = true; this.BtnFieldFont.UseVisualStyleBackColor = true;
...@@ -170,62 +185,66 @@ ...@@ -170,62 +185,66 @@
// //
// CboFieldType // CboFieldType
// //
this.CboFieldType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.CboFieldType.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.CboFieldType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.CboFieldType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CboFieldType.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.CboFieldType.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.CboFieldType.Font = new System.Drawing.Font("宋体", 11F); this.CboFieldType.Font = new System.Drawing.Font("宋体", 11F);
this.CboFieldType.FormattingEnabled = true; this.CboFieldType.FormattingEnabled = true;
this.CboFieldType.Location = new System.Drawing.Point(664, 83); this.CboFieldType.Location = new System.Drawing.Point(755, 96);
this.CboFieldType.Margin = new System.Windows.Forms.Padding(4);
this.CboFieldType.Name = "CboFieldType"; this.CboFieldType.Name = "CboFieldType";
this.CboFieldType.Size = new System.Drawing.Size(173, 23); this.CboFieldType.Size = new System.Drawing.Size(235, 23);
this.CboFieldType.TabIndex = 9; this.CboFieldType.TabIndex = 9;
this.CboFieldType.SelectedIndexChanged += new System.EventHandler(this.CboFieldType_SelectedIndexChanged); this.CboFieldType.SelectedIndexChanged += new System.EventHandler(this.CboFieldType_SelectedIndexChanged);
// //
// NumX // NumX
// //
this.NumX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.NumX.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.NumX.DecimalPlaces = 2; this.NumX.DecimalPlaces = 2;
this.NumX.Font = new System.Drawing.Font("宋体", 11F); this.NumX.Font = new System.Drawing.Font("宋体", 11F);
this.NumX.Location = new System.Drawing.Point(689, 112); this.NumX.Location = new System.Drawing.Point(857, 129);
this.NumX.Margin = new System.Windows.Forms.Padding(4);
this.NumX.Minimum = new decimal(new int[] { this.NumX.Minimum = new decimal(new int[] {
100, 100,
0, 0,
0, 0,
-2147483648}); -2147483648});
this.NumX.Name = "NumX"; this.NumX.Name = "NumX";
this.NumX.Size = new System.Drawing.Size(98, 24); this.NumX.Size = new System.Drawing.Size(131, 24);
this.NumX.TabIndex = 10; this.NumX.TabIndex = 10;
this.NumX.ValueChanged += new System.EventHandler(this.NumX_ValueChanged); this.NumX.ValueChanged += new System.EventHandler(this.NumX_ValueChanged);
// //
// NumY // NumY
// //
this.NumY.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.NumY.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.NumY.DecimalPlaces = 2; this.NumY.DecimalPlaces = 2;
this.NumY.Font = new System.Drawing.Font("宋体", 11F); this.NumY.Font = new System.Drawing.Font("宋体", 11F);
this.NumY.Location = new System.Drawing.Point(689, 142); this.NumY.Location = new System.Drawing.Point(857, 170);
this.NumY.Margin = new System.Windows.Forms.Padding(4);
this.NumY.Minimum = new decimal(new int[] { this.NumY.Minimum = new decimal(new int[] {
100, 100,
0, 0,
0, 0,
-2147483648}); -2147483648});
this.NumY.Name = "NumY"; this.NumY.Name = "NumY";
this.NumY.Size = new System.Drawing.Size(98, 24); this.NumY.Size = new System.Drawing.Size(131, 24);
this.NumY.TabIndex = 11; this.NumY.TabIndex = 11;
this.NumY.ValueChanged += new System.EventHandler(this.NumY_ValueChanged); this.NumY.ValueChanged += new System.EventHandler(this.NumY_ValueChanged);
// //
// NumW // NumW
// //
this.NumW.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.NumW.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.NumW.DecimalPlaces = 2; this.NumW.DecimalPlaces = 2;
this.NumW.Font = new System.Drawing.Font("宋体", 11F); this.NumW.Font = new System.Drawing.Font("宋体", 11F);
this.NumW.Location = new System.Drawing.Point(689, 172); this.NumW.Location = new System.Drawing.Point(857, 215);
this.NumW.Margin = new System.Windows.Forms.Padding(4);
this.NumW.Minimum = new decimal(new int[] { this.NumW.Minimum = new decimal(new int[] {
1, 1,
0, 0,
0, 0,
131072}); 131072});
this.NumW.Name = "NumW"; this.NumW.Name = "NumW";
this.NumW.Size = new System.Drawing.Size(98, 24); this.NumW.Size = new System.Drawing.Size(131, 24);
this.NumW.TabIndex = 12; this.NumW.TabIndex = 12;
this.NumW.Value = new decimal(new int[] { this.NumW.Value = new decimal(new int[] {
1, 1,
...@@ -236,17 +255,18 @@ ...@@ -236,17 +255,18 @@
// //
// NumH // NumH
// //
this.NumH.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.NumH.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.NumH.DecimalPlaces = 2; this.NumH.DecimalPlaces = 2;
this.NumH.Font = new System.Drawing.Font("宋体", 11F); this.NumH.Font = new System.Drawing.Font("宋体", 11F);
this.NumH.Location = new System.Drawing.Point(689, 202); this.NumH.Location = new System.Drawing.Point(857, 255);
this.NumH.Margin = new System.Windows.Forms.Padding(4);
this.NumH.Minimum = new decimal(new int[] { this.NumH.Minimum = new decimal(new int[] {
1, 1,
0, 0,
0, 0,
131072}); 131072});
this.NumH.Name = "NumH"; this.NumH.Name = "NumH";
this.NumH.Size = new System.Drawing.Size(98, 24); this.NumH.Size = new System.Drawing.Size(131, 24);
this.NumH.TabIndex = 13; this.NumH.TabIndex = 13;
this.NumH.Value = new decimal(new int[] { this.NumH.Value = new decimal(new int[] {
1, 1,
...@@ -257,78 +277,74 @@ ...@@ -257,78 +277,74 @@
// //
// TxtFormatText // TxtFormatText
// //
this.TxtFormatText.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.TxtFormatText.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.TxtFormatText.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.TxtFormatText.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.TxtFormatText.Location = new System.Drawing.Point(664, 232); this.TxtFormatText.Location = new System.Drawing.Point(756, 291);
this.TxtFormatText.Margin = new System.Windows.Forms.Padding(4);
this.TxtFormatText.Multiline = true; this.TxtFormatText.Multiline = true;
this.TxtFormatText.Name = "TxtFormatText"; this.TxtFormatText.Name = "TxtFormatText";
this.TxtFormatText.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.TxtFormatText.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.TxtFormatText.Size = new System.Drawing.Size(176, 133); this.TxtFormatText.Size = new System.Drawing.Size(234, 122);
this.TxtFormatText.TabIndex = 14; this.TxtFormatText.TabIndex = 14;
this.TxtFormatText.TextChanged += new System.EventHandler(this.TxtFormatText_TextChanged); this.TxtFormatText.TextChanged += new System.EventHandler(this.TxtFormatText_TextChanged);
// //
// pictureBox1
//
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox1.Location = new System.Drawing.Point(208, 46);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(441, 671);
this.pictureBox1.TabIndex = 15;
this.pictureBox1.TabStop = false;
//
// label1 // label1
// //
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(664, 115); this.label1.Location = new System.Drawing.Point(830, 133);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(16, 16); this.label1.Size = new System.Drawing.Size(15, 16);
this.label1.TabIndex = 16; this.label1.TabIndex = 16;
this.label1.Text = "X"; this.label1.Text = "X";
// //
// label2 // label2
// //
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label2.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(664, 145); this.label2.Location = new System.Drawing.Point(830, 177);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(16, 16); this.label2.Size = new System.Drawing.Size(15, 16);
this.label2.TabIndex = 17; this.label2.TabIndex = 17;
this.label2.Text = "Y"; this.label2.Text = "Y";
// //
// label3 // label3
// //
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(664, 175); this.label3.Location = new System.Drawing.Point(830, 219);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(16, 16); this.label3.Size = new System.Drawing.Size(15, 16);
this.label3.TabIndex = 18; this.label3.TabIndex = 18;
this.label3.Text = "W"; this.label3.Text = "W";
// //
// label4 // label4
// //
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label4.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label4.AutoSize = true; this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(664, 205); this.label4.Location = new System.Drawing.Point(830, 259);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(16, 16); this.label4.Size = new System.Drawing.Size(15, 16);
this.label4.TabIndex = 19; this.label4.TabIndex = 19;
this.label4.Text = "H"; this.label4.Text = "H";
// //
// groupBox1 // groupBox1
// //
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox1.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.groupBox1.Controls.Add(this.label_desc); this.groupBox1.Controls.Add(this.label_desc);
this.groupBox1.Location = new System.Drawing.Point(664, 400); this.groupBox1.Location = new System.Drawing.Point(755, 466);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(176, 167); this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
this.groupBox1.Size = new System.Drawing.Size(235, 209);
this.groupBox1.TabIndex = 20; this.groupBox1.TabIndex = 20;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "字段说明"; this.groupBox1.Text = "字段说明";
...@@ -336,60 +352,63 @@ ...@@ -336,60 +352,63 @@
// label_desc // label_desc
// //
this.label_desc.Dock = System.Windows.Forms.DockStyle.Fill; this.label_desc.Dock = System.Windows.Forms.DockStyle.Fill;
this.label_desc.Location = new System.Drawing.Point(3, 17); this.label_desc.Location = new System.Drawing.Point(4, 18);
this.label_desc.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label_desc.Name = "label_desc"; this.label_desc.Name = "label_desc";
this.label_desc.Size = new System.Drawing.Size(170, 147); this.label_desc.Size = new System.Drawing.Size(227, 187);
this.label_desc.TabIndex = 0; this.label_desc.TabIndex = 0;
this.label_desc.Text = " "; this.label_desc.Text = " ";
// //
// cb_keyword // cb_keyword
// //
this.cb_keyword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.cb_keyword.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.cb_keyword.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cb_keyword.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_keyword.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.cb_keyword.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cb_keyword.Font = new System.Drawing.Font("宋体", 11F); this.cb_keyword.Font = new System.Drawing.Font("宋体", 11F);
this.cb_keyword.FormattingEnabled = true; this.cb_keyword.FormattingEnabled = true;
this.cb_keyword.Location = new System.Drawing.Point(664, 371); this.cb_keyword.Location = new System.Drawing.Point(757, 432);
this.cb_keyword.Margin = new System.Windows.Forms.Padding(4);
this.cb_keyword.Name = "cb_keyword"; this.cb_keyword.Name = "cb_keyword";
this.cb_keyword.Size = new System.Drawing.Size(176, 23); this.cb_keyword.Size = new System.Drawing.Size(233, 23);
this.cb_keyword.TabIndex = 21; this.cb_keyword.TabIndex = 21;
this.cb_keyword.SelectedIndexChanged += new System.EventHandler(this.cb_keyword_SelectedIndexChanged); this.cb_keyword.SelectedIndexChanged += new System.EventHandler(this.cb_keyword_SelectedIndexChanged);
// //
// label5 // label5
// //
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label5.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(481, 17); this.label5.Location = new System.Drawing.Point(534, 10);
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5"; this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(64, 16); this.label5.Size = new System.Drawing.Size(46, 24);
this.label5.TabIndex = 25; this.label5.TabIndex = 25;
this.label5.Text = "Height:"; this.label5.Text = ":";
// //
// label6 // label6
// //
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label6.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(303, 17); this.label6.Location = new System.Drawing.Point(316, 9);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6"; this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(56, 16); this.label6.Size = new System.Drawing.Size(46, 25);
this.label6.TabIndex = 24; this.label6.TabIndex = 24;
this.label6.Text = "Width:"; this.label6.Text = ":";
// //
// NumLabelH // NumLabelH
// //
this.NumLabelH.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.NumLabelH.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.NumLabelH.DecimalPlaces = 2; this.NumLabelH.DecimalPlaces = 2;
this.NumLabelH.Font = new System.Drawing.Font("宋体", 11F); this.NumLabelH.Font = new System.Drawing.Font("宋体", 11F);
this.NumLabelH.Location = new System.Drawing.Point(551, 14); this.NumLabelH.Location = new System.Drawing.Point(588, 6);
this.NumLabelH.Margin = new System.Windows.Forms.Padding(4);
this.NumLabelH.Minimum = new decimal(new int[] { this.NumLabelH.Minimum = new decimal(new int[] {
1, 1,
0, 0,
0, 0,
131072}); 131072});
this.NumLabelH.Name = "NumLabelH"; this.NumLabelH.Name = "NumLabelH";
this.NumLabelH.Size = new System.Drawing.Size(98, 24); this.NumLabelH.Size = new System.Drawing.Size(131, 24);
this.NumLabelH.TabIndex = 23; this.NumLabelH.TabIndex = 23;
this.NumLabelH.Value = new decimal(new int[] { this.NumLabelH.Value = new decimal(new int[] {
1, 1,
...@@ -400,17 +419,18 @@ ...@@ -400,17 +419,18 @@
// //
// NumLabelW // NumLabelW
// //
this.NumLabelW.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.NumLabelW.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.NumLabelW.DecimalPlaces = 2; this.NumLabelW.DecimalPlaces = 2;
this.NumLabelW.Font = new System.Drawing.Font("宋体", 11F); this.NumLabelW.Font = new System.Drawing.Font("宋体", 11F);
this.NumLabelW.Location = new System.Drawing.Point(365, 14); this.NumLabelW.Location = new System.Drawing.Point(370, 6);
this.NumLabelW.Margin = new System.Windows.Forms.Padding(4);
this.NumLabelW.Minimum = new decimal(new int[] { this.NumLabelW.Minimum = new decimal(new int[] {
1, 1,
0, 0,
0, 0,
131072}); 131072});
this.NumLabelW.Name = "NumLabelW"; this.NumLabelW.Name = "NumLabelW";
this.NumLabelW.Size = new System.Drawing.Size(98, 24); this.NumLabelW.Size = new System.Drawing.Size(131, 24);
this.NumLabelW.TabIndex = 22; this.NumLabelW.TabIndex = 22;
this.NumLabelW.Value = new decimal(new int[] { this.NumLabelW.Value = new decimal(new int[] {
1, 1,
...@@ -421,19 +441,29 @@ ...@@ -421,19 +441,29 @@
// //
// label_labelsize // label_labelsize
// //
this.label_labelsize.AutoSize = true; this.label_labelsize.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label_labelsize.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label_labelsize.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_labelsize.Location = new System.Drawing.Point(205, 17); this.label_labelsize.Location = new System.Drawing.Point(166, 10);
this.label_labelsize.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label_labelsize.Name = "label_labelsize"; this.label_labelsize.Name = "label_labelsize";
this.label_labelsize.Size = new System.Drawing.Size(80, 16); this.label_labelsize.Size = new System.Drawing.Size(99, 20);
this.label_labelsize.TabIndex = 26; this.label_labelsize.TabIndex = 26;
this.label_labelsize.Text = "标签尺寸:"; this.label_labelsize.Text = "标签尺寸:";
// //
// pictureBox1
//
this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.pictureBox1.Location = new System.Drawing.Point(169, 42);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(563, 633);
this.pictureBox1.TabIndex = 15;
this.pictureBox1.TabStop = false;
//
// FrmLabel // FrmLabel
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1022, 703);
this.ClientSize = new System.Drawing.Size(1008, 729);
this.Controls.Add(this.label_labelsize); this.Controls.Add(this.label_labelsize);
this.Controls.Add(this.label5); this.Controls.Add(this.label5);
this.Controls.Add(this.label6); this.Controls.Add(this.label6);
...@@ -462,6 +492,7 @@ ...@@ -462,6 +492,7 @@
this.Controls.Add(this.BtnLabelNew); this.Controls.Add(this.BtnLabelNew);
this.Controls.Add(this.LstLabelName); this.Controls.Add(this.LstLabelName);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "FrmLabel"; this.Name = "FrmLabel";
this.ShowIcon = false; this.ShowIcon = false;
this.Text = "标签编辑"; this.Text = "标签编辑";
...@@ -471,10 +502,10 @@ ...@@ -471,10 +502,10 @@
((System.ComponentModel.ISupportInitialize)(this.NumY)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NumY)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NumW)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NumW)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NumH)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NumH)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.NumLabelH)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NumLabelH)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NumLabelW)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NumLabelW)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
...@@ -497,7 +528,6 @@ ...@@ -497,7 +528,6 @@
private System.Windows.Forms.NumericUpDown NumW; private System.Windows.Forms.NumericUpDown NumW;
private System.Windows.Forms.NumericUpDown NumH; private System.Windows.Forms.NumericUpDown NumH;
private System.Windows.Forms.TextBox TxtFormatText; private System.Windows.Forms.TextBox TxtFormatText;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
...@@ -510,5 +540,6 @@ ...@@ -510,5 +540,6 @@
private System.Windows.Forms.NumericUpDown NumLabelH; private System.Windows.Forms.NumericUpDown NumLabelH;
private System.Windows.Forms.NumericUpDown NumLabelW; private System.Windows.Forms.NumericUpDown NumLabelW;
private System.Windows.Forms.Label label_labelsize; private System.Windows.Forms.Label label_labelsize;
private System.Windows.Forms.PictureBox pictureBox1;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -7,9 +7,11 @@ using System.Data; ...@@ -7,9 +7,11 @@ using System.Data;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Net.NetworkInformation;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames;
namespace PrintLabel namespace PrintLabel
{ {
...@@ -304,7 +306,6 @@ namespace PrintLabel ...@@ -304,7 +306,6 @@ namespace PrintLabel
private void NumLabelH_ValueChanged(object sender, EventArgs e) private void NumLabelH_ValueChanged(object sender, EventArgs e)
{ {
Common.LabelPrint.SetLabelSize(Convert.ToSingle(Common.Label[Common.LabelPrint.LabelIndex].Size_mm.Width),Convert.ToSingle(NumLabelH.Value)); Common.LabelPrint.SetLabelSize(Convert.ToSingle(Common.Label[Common.LabelPrint.LabelIndex].Size_mm.Width),Convert.ToSingle(NumLabelH.Value));
}
}
} }
} }
using PrintLabel; using Microsoft.VisualBasic.ApplicationServices;
using PrintLabel;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
...@@ -10,6 +11,7 @@ using System.Runtime.InteropServices.ComTypes; ...@@ -10,6 +11,7 @@ using System.Runtime.InteropServices.ComTypes;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames; using static System.Net.Mime.MediaTypeNames;
namespace Asa namespace Asa
...@@ -248,7 +250,7 @@ namespace Asa ...@@ -248,7 +250,7 @@ namespace Asa
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns>是否打印成功</returns> /// <returns>是否打印成功</returns>
public bool PrintToTsc(Dictionary<string, string> key,out TscStauts tscStauts) public bool PrintToTsc(Dictionary<string, string> key,int x,int y,out TscStauts tscStauts)
{ {
tscStauts = CheckTscStatus(); tscStauts = CheckTscStatus();
if (tscStauts != 0) { if (tscStauts != 0) {
...@@ -261,7 +263,7 @@ namespace Asa ...@@ -261,7 +263,7 @@ namespace Asa
Bitmap bmp = null; Bitmap bmp = null;
try try
{ {
bmp = PrintPreview(key); bmp = PrintPreview(key);
var mm = Common.PxToMM(bmp.Width); var mm = Common.PxToMM(bmp.Width);
var nn = Common.PxToMM(bmp.Height); var nn = Common.PxToMM(bmp.Height);
TSCLIB_DLL.openport("USB"); TSCLIB_DLL.openport("USB");
...@@ -273,11 +275,11 @@ namespace Asa ...@@ -273,11 +275,11 @@ namespace Asa
SendCommand("SET ENCODER OFF"); //碳带编码器检测 SendCommand("SET ENCODER OFF"); //碳带编码器检测
SendCommand("OFFSET -10 mm"); //出纸偏移 SendCommand("OFFSET -10 mm"); //出纸偏移
SendCommand("SPEED 9"); //速度最大15 SendCommand("SPEED 9"); //速度最大15
SendCommand("DENSITY 12"); //浓度 SendCommand("DENSITY 15"); //浓度
SendCommand("DIRECTION 1"); SendCommand("DIRECTION 1");
SendCommand("SET PEEL OFF"); SendCommand("SET PEEL OFF");
TSCLIB_DLL.clearbuffer(); TSCLIB_DLL.clearbuffer();
TSCLIB_DLL.sendpicture(0, 0, bmp); TSCLIB_DLL.sendpicture(x, y, bmp);
TSCLIB_DLL.printlabel("1", "1"); TSCLIB_DLL.printlabel("1", "1");
TSCLIB_DLL.closeport(); TSCLIB_DLL.closeport();
Task.Delay(350).Wait(); Task.Delay(350).Wait();
...@@ -303,13 +305,15 @@ namespace Asa ...@@ -303,13 +305,15 @@ namespace Asa
Console.WriteLine(TSCLIB_DLL.sendcommand(command)); Console.WriteLine(TSCLIB_DLL.sendcommand(command));
} }
Task<Bitmap> printt;
/// <summary> /// <summary>
/// 打印 /// 打印
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns>是否打印成功</returns> /// <returns>是否打印成功</returns>
public bool PrintToTsc1(Dictionary<string, string> key, TscConfig tscConfig, out TscStauts tscStauts) public bool PrintToTsc_New(Dictionary<string, string> key, TscConfig tscConfig, out TscStauts tscStauts,out Bitmap bitmap)
{ {
bitmap = null;
tscStauts = CheckTscStatus(); tscStauts = CheckTscStatus();
if (tscStauts != 0) if (tscStauts != 0)
{ {
...@@ -317,12 +321,12 @@ namespace Asa ...@@ -317,12 +321,12 @@ namespace Asa
Console.WriteLine($"Error: {err}"); Console.WriteLine($"Error: {err}");
return false; return false;
} }
var t = Task.Run(() => printt=Task.Run(new Func<Bitmap>(() =>
{ {
Bitmap bmp = null; Bitmap bmp = null;
try try
{ {
bmp = PrintPreview(key); bmp = PrintPreview(key);
var mm = Common.PxToMM(bmp.Width); var mm = Common.PxToMM(bmp.Width);
var nn = Common.PxToMM(bmp.Height); var nn = Common.PxToMM(bmp.Height);
...@@ -330,27 +334,102 @@ namespace Asa ...@@ -330,27 +334,102 @@ namespace Asa
TSCLIB_DLL.openport(tscConfig.PrinterName); TSCLIB_DLL.openport(tscConfig.PrinterName);
TSCLIB_DLL.sendcommand($"SIZE {mm:0.00} mm, {nn:0.00} mm"); TSCLIB_DLL.sendcommand($"SIZE {mm:0.00} mm, {nn:0.00} mm");
TSCLIB_DLL.sendcommand($"GAP {tscConfig.Gap} mm,{tscConfig.GapOffset} mm"); TSCLIB_DLL.sendcommand($"GAP {tscConfig.Gap} mm,{tscConfig.GapOffset} mm");
TSCLIB_DLL.sendcommand("SET CUTTER ON"); //TSCLIB_DLL.sendcommand("SET CUTTER OFF");//裁剪模式
TSCLIB_DLL.sendcommand("SET RIBBON OFF"); //使用碳带 //TSCLIB_DLL.sendcommand($"SET PEEL ON");//剥离模式
TSCLIB_DLL.sendcommand("SET ENCODER OFF"); //碳带编码器检测 //TSCLIB_DLL.sendcommand("SET RIBBON ON"); //使用碳带
//TSCLIB_DLL.sendcommand("SET ENCODER OFF"); //碳带编码器检测
TSCLIB_DLL.sendcommand($"OFFSET {tscConfig.Offset} mm"); //出纸偏移 TSCLIB_DLL.sendcommand($"OFFSET {tscConfig.Offset} mm"); //出纸偏移
TSCLIB_DLL.sendcommand($"SPEED {tscConfig.Speed}"); //速度最大15 TSCLIB_DLL.sendcommand($"SPEED {tscConfig.Speed}"); //速度最大15
TSCLIB_DLL.sendcommand($"DENSITY {tscConfig.Density}"); //浓度最大15 TSCLIB_DLL.sendcommand($"DENSITY {tscConfig.Density}"); //浓度最大15
TSCLIB_DLL.sendcommand($"DIRECTION {tscConfig.Direction}"); TSCLIB_DLL.sendcommand($"DIRECTION {tscConfig.Direction}");
TSCLIB_DLL.sendcommand("SET PEEL OFF");
TSCLIB_DLL.clearbuffer();
TSCLIB_DLL.sendpicture(tscConfig.x, tscConfig.y, bmp);
TSCLIB_DLL.printlabel("1", "1");
TSCLIB_DLL.closeport();
//Task.Delay(350).Wait();
//bmp.Save(System.Windows.Forms.Application.StartupPath + $"\\PrintImage\\{DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-ffff")}.jpg");
return bmp;
}
catch (Exception e)
{
return bmp;
}
finally
{
//bmp?.Dispose();
}
}));
tscStauts = CheckTscStatus();
Console.WriteLine("After print:" + tscStauts);
Task.Delay(500).Wait();
if (printt.IsCompleted)
{
bitmap = printt.Result;
}
if (tscStauts == TscStauts.打印中 || tscStauts == TscStauts.准备就绪 || tscStauts == TscStauts.None)
{
return true;
}
else
{
return false;
}
//Console.WriteLine("usbportqueryprinter:" + TSCLIB_DLL.usbportqueryprinter());
}
/// <summary>
/// X400机器使用此打印方法
/// </summary>
/// <param name="key"></param>
/// <param name="tscConfig"></param>
/// <param name="tscStauts"></param>
/// <returns></returns>
public bool PrintToTsc_X400(Dictionary<string, string> key, TscConfig tscConfig, out TscStauts tscStauts)
{
tscStauts = CheckTscStatus();
if (tscStauts != 0)
{
var err = (TscStauts)tscStauts;
Console.WriteLine($"Error: {err}");
return false;
}
Task.Run(() =>
{
Bitmap bmp = null;
try
{
bmp = PrintPreview(key);
var mm = Common.PxToMM(bmp.Width);
var nn = Common.PxToMM(bmp.Height);
TSCSDK.driver TSCLIB_DLL = new TSCSDK.driver();
TSCLIB_DLL.openport(tscConfig.PrinterName);
TSCLIB_DLL.sendcommand($"SIZE {mm:0.00} mm, {nn:0.00} mm");
TSCLIB_DLL.sendcommand($"GAP {tscConfig.Gap} mm,{tscConfig.GapOffset} mm");//默认值2 0
TSCLIB_DLL.sendcommand($"SPEED {tscConfig.Speed}");//速度
TSCLIB_DLL.sendcommand($"DENSITY {tscConfig.Density}"); //浓度最大15
TSCLIB_DLL.sendcommand("SET RIBBON OFF");
TSCLIB_DLL.sendcommand($"DIRECTION {tscConfig.Direction},{tscConfig.Directions}");//默认值为1,0
TSCLIB_DLL.sendcommand("REFERENCE 0,0");
TSCLIB_DLL.sendcommand($"OFFSET {tscConfig.Offset} mm"); //出纸偏移
TSCLIB_DLL.sendcommand("SET STRIPER OFF");//撕纸状态
TSCLIB_DLL.sendcommand("SET CUTTER OFF");
TSCLIB_DLL.sendcommand("SET PEEL ON");//剥纸模式
TSCLIB_DLL.clearbuffer(); TSCLIB_DLL.clearbuffer();
TSCLIB_DLL.sendpicture(0, 0, bmp); TSCLIB_DLL.sendpicture(tscConfig.x, tscConfig.y, bmp);
TSCLIB_DLL.printlabel("1", "1"); TSCLIB_DLL.printlabel("1", "1");
TSCLIB_DLL.closeport(); TSCLIB_DLL.closeport();
Task.Delay(350).Wait(); Task.Delay(350).Wait();
} }
catch (Exception e) { } catch (Exception)
{
}
finally finally
{ {
bmp?.Dispose(); bmp?.Dispose();
} }
}); });
t.Wait(1000);
tscStauts = CheckTscStatus(); tscStauts = CheckTscStatus();
Console.WriteLine("After print:" + tscStauts); Console.WriteLine("After print:" + tscStauts);
if (tscStauts == TscStauts.打印中 || tscStauts == TscStauts.准备就绪 || tscStauts == TscStauts.None) if (tscStauts == TscStauts.打印中 || tscStauts == TscStauts.准备就绪 || tscStauts == TscStauts.None)
...@@ -362,9 +441,53 @@ namespace Asa ...@@ -362,9 +441,53 @@ namespace Asa
//Console.WriteLine("usbportqueryprinter:" + TSCLIB_DLL.usbportqueryprinter()); //Console.WriteLine("usbportqueryprinter:" + TSCLIB_DLL.usbportqueryprinter());
} }
/// <summary>
/// 完整的打印逻辑
/// </summary>
/// <param name="key"></param>
/// <param name="tscConfig"></param>
/// <param name="tscStauts"></param>
/// <returns></returns>
public bool PrintToTsc_X6(Dictionary<string, string> key, TscConfig tscConfig, out TscStauts tscStauts)
{
Bitmap bmp = null;
try
{
bmp = PrintPreview(key);
var mm = Common.PxToMM(bmp.Width);
var nn = Common.PxToMM(bmp.Height);
TSCSDK.driver TSCLIB_DLL = new TSCSDK.driver();
TSCLIB_DLL.openport(tscConfig.PrinterName);
TSCLIB_DLL.sendcommand($"SIZE 59.9 mm, 39.9 mm");
TSCLIB_DLL.sendcommand($"GAP 2 mm,0 mm");
TSCLIB_DLL.sendcommand($"SPEED 11");//速度
TSCLIB_DLL.sendcommand($"DENSITY 15"); //浓度最大15
TSCLIB_DLL.sendcommand("SET RIBBON OFF");
TSCLIB_DLL.sendcommand($"DIRECTION 1,0");
TSCLIB_DLL.sendcommand("REFERENCE 0,0");
TSCLIB_DLL.sendcommand($"OFFSET 10 mm"); //出纸偏移
TSCLIB_DLL.sendcommand("SET STRIPER ON");
TSCLIB_DLL.sendcommand("SET CUTTER OFF");
//TSCLIB_DLL.sendcommand("SET PEEL ON");
TSCLIB_DLL.clearbuffer();
TSCLIB_DLL.sendpicture(tscConfig.x, tscConfig.y, bmp);
TSCLIB_DLL.printlabel("1", "1");
TSCLIB_DLL.closeport();
Task.Delay(350).Wait();
}
catch (Exception)
{
}
finally
{
bmp?.Dispose();
}
tscStauts = TscStauts.打印中;
return true;
//Console.WriteLine("usbportqueryprinter:" + TSCLIB_DLL.usbportqueryprinter());
}
TscStauts CheckTscStatus() { TscStauts CheckTscStatus() {
//return TscStauts.准备就绪;
TscStauts s = TscStauts.None; TscStauts s = TscStauts.None;
var t = Task.Run(() => { var t = Task.Run(() => {
Console.WriteLine("TID:"+ GetCurrentThreadId().ToString("X")); Console.WriteLine("TID:"+ GetCurrentThreadId().ToString("X"));
...@@ -415,8 +538,8 @@ namespace Asa ...@@ -415,8 +538,8 @@ namespace Asa
b = 1<<1, b = 1<<1,
c = 1<<2, c = 1<<2,
} }
public class TscConfig { public class TscConfig
{
/// <summary> /// <summary>
/// 打印机名称 /// 打印机名称
/// </summary> /// </summary>
...@@ -433,6 +556,7 @@ namespace Asa ...@@ -433,6 +556,7 @@ namespace Asa
/// 打印方向 1横向,0纵向,默认1 /// 打印方向 1横向,0纵向,默认1
/// </summary> /// </summary>
public int Direction = 1; public int Direction = 1;
public int Directions = 0;
/// <summary> /// <summary>
/// 出纸偏移量mm,默认-10mm /// 出纸偏移量mm,默认-10mm
/// </summary> /// </summary>
...@@ -445,6 +569,15 @@ namespace Asa ...@@ -445,6 +569,15 @@ namespace Asa
/// 打印浓度 1-15,默认12 /// 打印浓度 1-15,默认12
/// </summary> /// </summary>
public int Density = 12; public int Density = 12;
/// <summary>
/// 打印x轴偏移量
/// </summary>
public int x = 0;
/// <summary>
/// 打印y轴偏移量
/// </summary>
public int y = 0;
} }
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Asa</RootNamespace> <RootNamespace>Asa</RootNamespace>
<AssemblyName>Asa.PrintLabel</AssemblyName> <AssemblyName>Asa.PrintLabel</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="ZXing.Net" version="0.16.9" targetFramework="net462" /> <package id="ZXing.Net" version="0.16.9" targetFramework="net462" requireReinstallation="true" />
</packages> </packages>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
</configuration> </configuration>
...@@ -39,14 +39,17 @@ ...@@ -39,14 +39,17 @@
this.btn_tsc = new System.Windows.Forms.Button(); this.btn_tsc = new System.Windows.Forms.Button();
this.cb_labelname = new System.Windows.Forms.ComboBox(); this.cb_labelname = new System.Windows.Forms.ComboBox();
this.advanceConfigEdit1 = new ConfigHelper.AdvanceConfigEdit(); this.advanceConfigEdit1 = new ConfigHelper.AdvanceConfigEdit();
this.button7 = new System.Windows.Forms.Button();
this.button10 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// button1 // button1
// //
this.button1.Location = new System.Drawing.Point(142, 68); this.button1.Location = new System.Drawing.Point(13, 13);
this.button1.Margin = new System.Windows.Forms.Padding(4);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(123, 49); this.button1.Size = new System.Drawing.Size(184, 74);
this.button1.TabIndex = 0; this.button1.TabIndex = 0;
this.button1.Text = "编辑"; this.button1.Text = "编辑";
this.button1.UseVisualStyleBackColor = true; this.button1.UseVisualStyleBackColor = true;
...@@ -54,17 +57,19 @@ ...@@ -54,17 +57,19 @@
// //
// textBox1 // textBox1
// //
this.textBox1.Location = new System.Drawing.Point(362, 68); this.textBox1.Location = new System.Drawing.Point(205, 14);
this.textBox1.Margin = new System.Windows.Forms.Padding(4);
this.textBox1.Name = "textBox1"; this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(162, 21); this.textBox1.Size = new System.Drawing.Size(241, 28);
this.textBox1.TabIndex = 1; this.textBox1.TabIndex = 1;
this.textBox1.Text = "test2"; this.textBox1.Text = "test2";
// //
// button2 // button2
// //
this.button2.Location = new System.Drawing.Point(362, 122); this.button2.Location = new System.Drawing.Point(205, 102);
this.button2.Margin = new System.Windows.Forms.Padding(4);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(100, 23); this.button2.Size = new System.Drawing.Size(150, 34);
this.button2.TabIndex = 2; this.button2.TabIndex = 2;
this.button2.Text = "加载"; this.button2.Text = "加载";
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
...@@ -72,9 +77,10 @@ ...@@ -72,9 +77,10 @@
// //
// button3 // button3
// //
this.button3.Location = new System.Drawing.Point(142, 123); this.button3.Location = new System.Drawing.Point(13, 102);
this.button3.Margin = new System.Windows.Forms.Padding(4);
this.button3.Name = "button3"; this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(123, 49); this.button3.Size = new System.Drawing.Size(184, 74);
this.button3.TabIndex = 3; this.button3.TabIndex = 3;
this.button3.Text = "打印"; this.button3.Text = "打印";
this.button3.UseVisualStyleBackColor = true; this.button3.UseVisualStyleBackColor = true;
...@@ -82,17 +88,19 @@ ...@@ -82,17 +88,19 @@
// //
// textBox2 // textBox2
// //
this.textBox2.Location = new System.Drawing.Point(362, 95); this.textBox2.Location = new System.Drawing.Point(205, 59);
this.textBox2.Margin = new System.Windows.Forms.Padding(4);
this.textBox2.Name = "textBox2"; this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(162, 21); this.textBox2.Size = new System.Drawing.Size(241, 28);
this.textBox2.TabIndex = 4; this.textBox2.TabIndex = 4;
this.textBox2.Text = "ZDesigner GT800 (EPL)"; this.textBox2.Text = "ZDesigner GT800 (EPL)";
// //
// button4 // button4
// //
this.button4.Location = new System.Drawing.Point(362, 217); this.button4.Location = new System.Drawing.Point(205, 144);
this.button4.Margin = new System.Windows.Forms.Padding(4);
this.button4.Name = "button4"; this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(100, 23); this.button4.Size = new System.Drawing.Size(150, 34);
this.button4.TabIndex = 5; this.button4.TabIndex = 5;
this.button4.Text = "获取状态"; this.button4.Text = "获取状态";
this.button4.UseVisualStyleBackColor = true; this.button4.UseVisualStyleBackColor = true;
...@@ -100,17 +108,19 @@ ...@@ -100,17 +108,19 @@
// //
// pictureBox1 // pictureBox1
// //
this.pictureBox1.Location = new System.Drawing.Point(509, 123); this.pictureBox1.Location = new System.Drawing.Point(456, 426);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(251, 163); this.pictureBox1.Size = new System.Drawing.Size(376, 244);
this.pictureBox1.TabIndex = 6; this.pictureBox1.TabIndex = 6;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //
// button5 // button5
// //
this.button5.Location = new System.Drawing.Point(142, 178); this.button5.Location = new System.Drawing.Point(13, 188);
this.button5.Margin = new System.Windows.Forms.Padding(4);
this.button5.Name = "button5"; this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(123, 47); this.button5.Size = new System.Drawing.Size(184, 70);
this.button5.TabIndex = 7; this.button5.TabIndex = 7;
this.button5.Text = "button5"; this.button5.Text = "button5";
this.button5.UseVisualStyleBackColor = true; this.button5.UseVisualStyleBackColor = true;
...@@ -118,9 +128,10 @@ ...@@ -118,9 +128,10 @@
// //
// btn_tsc // btn_tsc
// //
this.btn_tsc.Location = new System.Drawing.Point(82, 377); this.btn_tsc.Location = new System.Drawing.Point(24, 437);
this.btn_tsc.Margin = new System.Windows.Forms.Padding(4);
this.btn_tsc.Name = "btn_tsc"; this.btn_tsc.Name = "btn_tsc";
this.btn_tsc.Size = new System.Drawing.Size(123, 42); this.btn_tsc.Size = new System.Drawing.Size(184, 63);
this.btn_tsc.TabIndex = 8; this.btn_tsc.TabIndex = 8;
this.btn_tsc.Text = "TSC Print"; this.btn_tsc.Text = "TSC Print";
this.btn_tsc.UseVisualStyleBackColor = true; this.btn_tsc.UseVisualStyleBackColor = true;
...@@ -129,23 +140,49 @@ ...@@ -129,23 +140,49 @@
// cb_labelname // cb_labelname
// //
this.cb_labelname.FormattingEnabled = true; this.cb_labelname.FormattingEnabled = true;
this.cb_labelname.Location = new System.Drawing.Point(82, 351); this.cb_labelname.Location = new System.Drawing.Point(24, 378);
this.cb_labelname.Margin = new System.Windows.Forms.Padding(4);
this.cb_labelname.Name = "cb_labelname"; this.cb_labelname.Name = "cb_labelname";
this.cb_labelname.Size = new System.Drawing.Size(160, 20); this.cb_labelname.Size = new System.Drawing.Size(238, 26);
this.cb_labelname.TabIndex = 9; this.cb_labelname.TabIndex = 9;
// //
// advanceConfigEdit1 // advanceConfigEdit1
// //
this.advanceConfigEdit1.Location = new System.Drawing.Point(283, 303); this.advanceConfigEdit1.Location = new System.Drawing.Point(456, 13);
this.advanceConfigEdit1.Margin = new System.Windows.Forms.Padding(6);
this.advanceConfigEdit1.Name = "advanceConfigEdit1"; this.advanceConfigEdit1.Name = "advanceConfigEdit1";
this.advanceConfigEdit1.Size = new System.Drawing.Size(404, 273); this.advanceConfigEdit1.Size = new System.Drawing.Size(655, 391);
this.advanceConfigEdit1.TabIndex = 10; this.advanceConfigEdit1.TabIndex = 10;
// //
// button7
//
this.button7.Location = new System.Drawing.Point(24, 508);
this.button7.Margin = new System.Windows.Forms.Padding(4);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(184, 63);
this.button7.TabIndex = 12;
this.button7.Text = "X400";
this.button7.UseVisualStyleBackColor = true;
this.button7.Click += new System.EventHandler(this.button7_Click);
//
// button10
//
this.button10.Location = new System.Drawing.Point(24, 588);
this.button10.Margin = new System.Windows.Forms.Padding(4);
this.button10.Name = "button10";
this.button10.Size = new System.Drawing.Size(184, 63);
this.button10.TabIndex = 15;
this.button10.Text = "X6";
this.button10.UseVisualStyleBackColor = true;
this.button10.Click += new System.EventHandler(this.button10_Click);
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(885, 588); this.ClientSize = new System.Drawing.Size(1366, 911);
this.Controls.Add(this.button10);
this.Controls.Add(this.button7);
this.Controls.Add(this.advanceConfigEdit1); this.Controls.Add(this.advanceConfigEdit1);
this.Controls.Add(this.cb_labelname); this.Controls.Add(this.cb_labelname);
this.Controls.Add(this.btn_tsc); this.Controls.Add(this.btn_tsc);
...@@ -157,6 +194,7 @@ ...@@ -157,6 +194,7 @@
this.Controls.Add(this.button2); this.Controls.Add(this.button2);
this.Controls.Add(this.textBox1); this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "Form1"; this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Form1"; this.Text = "Form1";
...@@ -180,6 +218,8 @@ ...@@ -180,6 +218,8 @@
private System.Windows.Forms.Button btn_tsc; private System.Windows.Forms.Button btn_tsc;
private System.Windows.Forms.ComboBox cb_labelname; private System.Windows.Forms.ComboBox cb_labelname;
private ConfigHelper.AdvanceConfigEdit advanceConfigEdit1; private ConfigHelper.AdvanceConfigEdit advanceConfigEdit1;
private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button10;
} }
} }
...@@ -81,7 +81,11 @@ namespace PrintLabel_Test ...@@ -81,7 +81,11 @@ namespace PrintLabel_Test
tscConfig.Offset = ConfigHelper.Config.Get("Tsc_Offset", -17D); tscConfig.Offset = ConfigHelper.Config.Get("Tsc_Offset", -17D);
tscConfig.Speed = ConfigHelper.Config.Get("Tsc_Speed", 9); tscConfig.Speed = ConfigHelper.Config.Get("Tsc_Speed", 9);
tscConfig.Density = ConfigHelper.Config.Get("Tsc_Density", 12); tscConfig.Density = ConfigHelper.Config.Get("Tsc_Density", 12);
print.PrintToTsc1(text, tscConfig, out TscStauts tscStauts); tscConfig.x = ConfigHelper.Config.Get("Tsc_x", 9);
tscConfig.y = ConfigHelper.Config.Get("Tsc_y", 12);
tscConfig.Gap = ConfigHelper.Config.Get("Tsc_Gap", 3);
tscConfig.GapOffset = ConfigHelper.Config.Get("Tsc_GapOffset", 0.3);
print.PrintToTsc_New(text, tscConfig, out TscStauts tscStauts,out Bitmap bmp);
return; return;
} }
...@@ -92,5 +96,43 @@ namespace PrintLabel_Test ...@@ -92,5 +96,43 @@ namespace PrintLabel_Test
if (cb_labelname.Items.Count>0) if (cb_labelname.Items.Count>0)
cb_labelname.SelectedIndex = 0; cb_labelname.SelectedIndex = 0;
} }
private void button7_Click(object sender, EventArgs e)
{
Dictionary<string, string> text = new Dictionary<string, string>();
text.Add("ri", "123123123123123");
text.Add("pn", "yumtr3123123j");
Dictionary<string, string> keys = new Dictionary<string, string>();
//TSCLIB_DLL.sendcommand("HOME");
print.SetResolution(300);
print.GetLabelName();
print.LoadLabel(cb_labelname.SelectedItem.ToString());
TscConfig tscConfig = new TscConfig();
tscConfig.Offset = ConfigHelper.Config.Get("Tsc_Offset", -17D);
tscConfig.Speed = ConfigHelper.Config.Get("Tsc_Speed", 9);
tscConfig.Density = ConfigHelper.Config.Get("Tsc_Density", 12);
tscConfig.GapOffset = ConfigHelper.Config.Get("Tsc_GapOffset", 0);
tscConfig.Gap = ConfigHelper.Config.Get("Tsc_Gap", 0);
print.PrintToTsc_X400(keys, tscConfig, out TscStauts tscStauts);
}
private void button10_Click(object sender, EventArgs e)
{
Dictionary<string, string> text = new Dictionary<string, string>();
text.Add("ri", "666");
text.Add("pn", "777");
Dictionary<string, string> keys = new Dictionary<string, string>();
//TSCLIB_DLL.sendcommand("HOME");
print.SetResolution(300);
print.GetLabelName();
print.LoadLabel(cb_labelname.SelectedItem.ToString());
TscConfig tscConfig = new TscConfig();
tscConfig.Offset = ConfigHelper.Config.Get("Tsc_Offset", -17D);
tscConfig.Speed = ConfigHelper.Config.Get("Tsc_Speed", 9);
tscConfig.Density = ConfigHelper.Config.Get("Tsc_Density", 12);
tscConfig.GapOffset = ConfigHelper.Config.Get("Tsc_GapOffset", 0);
tscConfig.Directions = ConfigHelper.Config.Get("Tsc_Directions", 1);
print.PrintToTsc_X6(keys, tscConfig, out TscStauts tscStauts);
}
} }
} }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>PrintLabel_Test</RootNamespace> <RootNamespace>PrintLabel_Test</RootNamespace>
<AssemblyName>PrintLabel_Test</AssemblyName> <AssemblyName>PrintLabel_Test</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="ConfigHelper"> <Reference Include="ConfigHelper">
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath> <HintPath>..\..\..\类库\ConfigHelper.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.VisualBasic" /> <Reference Include="Microsoft.VisualBasic" />
<Reference Include="SdkApi.Desktop, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SdkApi.Desktop, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
...@@ -54,6 +54,10 @@ ...@@ -54,6 +54,10 @@
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="ZebraPrinterHelper, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\ZebraPrinterHelper.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Form1.cs"> <Compile Include="Form1.cs">
...@@ -104,10 +108,6 @@ ...@@ -104,10 +108,6 @@
<Project>{b8f25ece-dee6-41d6-8ef0-8afbf2577c17}</Project> <Project>{b8f25ece-dee6-41d6-8ef0-8afbf2577c17}</Project>
<Name>PrintLabel</Name> <Name>PrintLabel</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\ZebraPrinterHelper\ZebraPrinterHelper.csproj">
<Project>{e4f7afc7-2f6d-4685-8350-3c05697428ea}</Project>
<Name>ZebraPrinterHelper</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file \ No newline at end of file
...@@ -19,7 +19,7 @@ namespace PrintLabel_Test.Properties { ...@@ -19,7 +19,7 @@ namespace PrintLabel_Test.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。 // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
......
...@@ -12,7 +12,7 @@ namespace PrintLabel_Test.Properties { ...@@ -12,7 +12,7 @@ namespace PrintLabel_Test.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
</configuration> </configuration>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>Zebra.Windows.DevDemo</RootNamespace> <RootNamespace>Zebra.Windows.DevDemo</RootNamespace>
<AssemblyName>DeveloperDemo.Windows</AssemblyName> <AssemblyName>DeveloperDemo.Windows</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // 此代码由工具生成。
// Runtime Version:4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // 对此文件的更改可能会导致不正确的行为,并且如果
// the code is regenerated. // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -13,13 +13,13 @@ namespace Zebra.Windows.DevDemo.Properties { ...@@ -13,13 +13,13 @@ namespace Zebra.Windows.DevDemo.Properties {
/// <summary> /// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc. /// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary> /// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder // 此类是由 StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio. // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// To add or remove a member, edit your .ResX file then rerun ResGen // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// with the /str option, or rebuild your VS project. // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
...@@ -33,7 +33,7 @@ namespace Zebra.Windows.DevDemo.Properties { ...@@ -33,7 +33,7 @@ namespace Zebra.Windows.DevDemo.Properties {
} }
/// <summary> /// <summary>
/// Returns the cached ResourceManager instance used by this class. /// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
...@@ -47,8 +47,8 @@ namespace Zebra.Windows.DevDemo.Properties { ...@@ -47,8 +47,8 @@ namespace Zebra.Windows.DevDemo.Properties {
} }
/// <summary> /// <summary>
/// Overrides the current thread's CurrentUICulture property for all /// 重写当前线程的 CurrentUICulture 属性,对
/// resource lookups using this strongly typed resource class. /// 使用此强类型资源类的所有资源查找执行重写。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { internal static global::System.Globalization.CultureInfo Culture {
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // 此代码由工具生成。
// Runtime Version:4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // 对此文件的更改可能会导致不正确的行为,并且如果
// the code is regenerated. // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -12,7 +12,7 @@ namespace Zebra.Windows.DevDemo.Properties { ...@@ -12,7 +12,7 @@ namespace Zebra.Windows.DevDemo.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
</configuration> </configuration>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>ZebraPrinterHelper</RootNamespace> <RootNamespace>ZebraPrinterHelper</RootNamespace>
<AssemblyName>ZebraPrinterHelper</AssemblyName> <AssemblyName>ZebraPrinterHelper</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!