فهرست منبع

修改单项功能主窗体图像显示

wb_han 5 سال پیش
والد
کامیت
f398e150ec
5فایلهای تغییر یافته به همراه143 افزوده شده و 187 حذف شده
  1. 24 63
      HOZProject/FormShowImage.Designer.cs
  2. 2 4
      HOZProject/FormShowImage.cs
  3. 80 91
      HOZProject/FormUCMain.Designer.cs
  4. 29 21
      HOZProject/FormUCMain.cs
  5. 8 8
      HOZProject/UnitControl.csproj

+ 24 - 63
HOZProject/FormShowImage.Designer.cs

@@ -34,11 +34,9 @@
             this.plImageInfo = new System.Windows.Forms.Panel();
             this.lblContent = new System.Windows.Forms.Label();
             this.lblMag = new System.Windows.Forms.Label();
-            this.lblKV = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
             this.lblAutoContent = new System.Windows.Forms.Label();
             this.lblAutoMag = new System.Windows.Forms.Label();
-            this.lblAutoKV = new System.Windows.Forms.Label();
             this.pbAutoImage = new System.Windows.Forms.PictureBox();
             ((System.ComponentModel.ISupportInitialize)(this.pichide)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.picexit)).BeginInit();
@@ -54,10 +52,10 @@
             this.pichide.BackColor = System.Drawing.Color.Transparent;
             this.pichide.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pichide.Image = global::HOZProject.Properties.Resources.Min_Gray;
-            this.pichide.Location = new System.Drawing.Point(1501, 14);
-            this.pichide.Margin = new System.Windows.Forms.Padding(6);
+            this.pichide.Location = new System.Drawing.Point(1001, 9);
+            this.pichide.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pichide.Name = "pichide";
-            this.pichide.Size = new System.Drawing.Size(20, 20);
+            this.pichide.Size = new System.Drawing.Size(13, 13);
             this.pichide.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
             this.pichide.TabIndex = 58;
             this.pichide.TabStop = false;
@@ -69,10 +67,10 @@
             this.picexit.BackColor = System.Drawing.Color.Transparent;
             this.picexit.Cursor = System.Windows.Forms.Cursors.Hand;
             this.picexit.Image = global::HOZProject.Properties.Resources.exit_Gray;
-            this.picexit.Location = new System.Drawing.Point(1525, 14);
-            this.picexit.Margin = new System.Windows.Forms.Padding(6);
+            this.picexit.Location = new System.Drawing.Point(1017, 9);
+            this.picexit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.picexit.Name = "picexit";
-            this.picexit.Size = new System.Drawing.Size(20, 20);
+            this.picexit.Size = new System.Drawing.Size(13, 13);
             this.picexit.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
             this.picexit.TabIndex = 57;
             this.picexit.TabStop = false;
@@ -81,10 +79,9 @@
             // pbImage
             // 
             this.pbImage.BackColor = System.Drawing.Color.White;
-            this.pbImage.Location = new System.Drawing.Point(4, 44);
-            this.pbImage.Margin = new System.Windows.Forms.Padding(4);
+            this.pbImage.Location = new System.Drawing.Point(3, 29);
             this.pbImage.Name = "pbImage";
-            this.pbImage.Size = new System.Drawing.Size(768, 576);
+            this.pbImage.Size = new System.Drawing.Size(512, 384);
             this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
             this.pbImage.TabIndex = 59;
             this.pbImage.TabStop = false;
@@ -94,11 +91,9 @@
             this.plImageInfo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(183)))), ((int)(((byte)(183)))), ((int)(((byte)(183)))));
             this.plImageInfo.Controls.Add(this.lblContent);
             this.plImageInfo.Controls.Add(this.lblMag);
-            this.plImageInfo.Controls.Add(this.lblKV);
-            this.plImageInfo.Location = new System.Drawing.Point(4, 620);
-            this.plImageInfo.Margin = new System.Windows.Forms.Padding(4);
+            this.plImageInfo.Location = new System.Drawing.Point(3, 413);
             this.plImageInfo.Name = "plImageInfo";
-            this.plImageInfo.Size = new System.Drawing.Size(768, 64);
+            this.plImageInfo.Size = new System.Drawing.Size(512, 43);
             this.plImageInfo.TabIndex = 60;
             // 
             // lblContent
@@ -106,10 +101,9 @@
             this.lblContent.AutoSize = true;
             this.lblContent.Font = new System.Drawing.Font("宋体", 12F);
             this.lblContent.ForeColor = System.Drawing.Color.White;
-            this.lblContent.Location = new System.Drawing.Point(532, 20);
-            this.lblContent.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lblContent.Location = new System.Drawing.Point(135, 13);
             this.lblContent.Name = "lblContent";
-            this.lblContent.Size = new System.Drawing.Size(190, 24);
+            this.lblContent.Size = new System.Drawing.Size(128, 16);
             this.lblContent.TabIndex = 1;
             this.lblContent.Text = "工作距离:8.2mm";
             // 
@@ -118,35 +112,20 @@
             this.lblMag.AutoSize = true;
             this.lblMag.Font = new System.Drawing.Font("宋体", 12F);
             this.lblMag.ForeColor = System.Drawing.Color.White;
-            this.lblMag.Location = new System.Drawing.Point(258, 20);
-            this.lblMag.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lblMag.Location = new System.Drawing.Point(9, 13);
             this.lblMag.Name = "lblMag";
-            this.lblMag.Size = new System.Drawing.Size(178, 24);
+            this.lblMag.Size = new System.Drawing.Size(120, 16);
             this.lblMag.TabIndex = 1;
             this.lblMag.Text = "放大倍数:200X";
             // 
-            // lblKV
-            // 
-            this.lblKV.AutoSize = true;
-            this.lblKV.Font = new System.Drawing.Font("宋体", 12F);
-            this.lblKV.ForeColor = System.Drawing.Color.White;
-            this.lblKV.Location = new System.Drawing.Point(32, 20);
-            this.lblKV.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.lblKV.Name = "lblKV";
-            this.lblKV.Size = new System.Drawing.Size(130, 24);
-            this.lblKV.TabIndex = 1;
-            this.lblKV.Text = "电压:20KV";
-            // 
             // panel1
             // 
             this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(183)))), ((int)(((byte)(183)))), ((int)(((byte)(183)))));
             this.panel1.Controls.Add(this.lblAutoContent);
             this.panel1.Controls.Add(this.lblAutoMag);
-            this.panel1.Controls.Add(this.lblAutoKV);
-            this.panel1.Location = new System.Drawing.Point(775, 620);
-            this.panel1.Margin = new System.Windows.Forms.Padding(4);
+            this.panel1.Location = new System.Drawing.Point(517, 413);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(768, 64);
+            this.panel1.Size = new System.Drawing.Size(512, 43);
             this.panel1.TabIndex = 62;
             // 
             // lblAutoContent
@@ -154,10 +133,9 @@
             this.lblAutoContent.AutoSize = true;
             this.lblAutoContent.Font = new System.Drawing.Font("宋体", 12F);
             this.lblAutoContent.ForeColor = System.Drawing.Color.White;
-            this.lblAutoContent.Location = new System.Drawing.Point(522, 20);
-            this.lblAutoContent.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lblAutoContent.Location = new System.Drawing.Point(130, 13);
             this.lblAutoContent.Name = "lblAutoContent";
-            this.lblAutoContent.Size = new System.Drawing.Size(190, 24);
+            this.lblAutoContent.Size = new System.Drawing.Size(128, 16);
             this.lblAutoContent.TabIndex = 1;
             this.lblAutoContent.Text = "工作距离:8.2mm";
             // 
@@ -166,42 +144,28 @@
             this.lblAutoMag.AutoSize = true;
             this.lblAutoMag.Font = new System.Drawing.Font("宋体", 12F);
             this.lblAutoMag.ForeColor = System.Drawing.Color.White;
-            this.lblAutoMag.Location = new System.Drawing.Point(258, 20);
-            this.lblAutoMag.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lblAutoMag.Location = new System.Drawing.Point(4, 13);
             this.lblAutoMag.Name = "lblAutoMag";
-            this.lblAutoMag.Size = new System.Drawing.Size(178, 24);
+            this.lblAutoMag.Size = new System.Drawing.Size(120, 16);
             this.lblAutoMag.TabIndex = 1;
             this.lblAutoMag.Text = "放大倍数:200X";
             // 
-            // lblAutoKV
-            // 
-            this.lblAutoKV.AutoSize = true;
-            this.lblAutoKV.Font = new System.Drawing.Font("宋体", 12F);
-            this.lblAutoKV.ForeColor = System.Drawing.Color.White;
-            this.lblAutoKV.Location = new System.Drawing.Point(32, 20);
-            this.lblAutoKV.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.lblAutoKV.Name = "lblAutoKV";
-            this.lblAutoKV.Size = new System.Drawing.Size(130, 24);
-            this.lblAutoKV.TabIndex = 1;
-            this.lblAutoKV.Text = "电压:20KV";
-            // 
             // pbAutoImage
             // 
             this.pbAutoImage.BackColor = System.Drawing.Color.White;
-            this.pbAutoImage.Location = new System.Drawing.Point(775, 44);
-            this.pbAutoImage.Margin = new System.Windows.Forms.Padding(4);
+            this.pbAutoImage.Location = new System.Drawing.Point(517, 29);
             this.pbAutoImage.Name = "pbAutoImage";
-            this.pbAutoImage.Size = new System.Drawing.Size(768, 576);
+            this.pbAutoImage.Size = new System.Drawing.Size(512, 384);
             this.pbAutoImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
             this.pbAutoImage.TabIndex = 61;
             this.pbAutoImage.TabStop = false;
             // 
             // FormShowImage
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.Black;
-            this.ClientSize = new System.Drawing.Size(1550, 688);
+            this.ClientSize = new System.Drawing.Size(1033, 459);
             this.Controls.Add(this.panel1);
             this.Controls.Add(this.pbAutoImage);
             this.Controls.Add(this.plImageInfo);
@@ -209,7 +173,6 @@
             this.Controls.Add(this.pichide);
             this.Controls.Add(this.picexit);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "FormShowImage";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "FormShowImage";
@@ -233,13 +196,11 @@
         private System.Windows.Forms.PictureBox pichide;
         private System.Windows.Forms.PictureBox picexit;
         private System.Windows.Forms.Panel plImageInfo;
-        private System.Windows.Forms.Label lblKV;
         private System.Windows.Forms.Label lblContent;
         private System.Windows.Forms.Label lblMag;
         private System.Windows.Forms.Panel panel1;
         private System.Windows.Forms.Label lblAutoContent;
         private System.Windows.Forms.Label lblAutoMag;
-        private System.Windows.Forms.Label lblAutoKV;
         public System.Windows.Forms.PictureBox pbImage;
         public System.Windows.Forms.PictureBox pbAutoImage;
     }

+ 2 - 4
HOZProject/FormShowImage.cs

@@ -60,6 +60,7 @@ namespace HOZProject
         public FormShowImage()
         {
             InitializeComponent();
+            Control.CheckForIllegalCrossThreadCalls = false;
         }
 
         #region 拖动窗体
@@ -99,18 +100,15 @@ namespace HOZProject
         #region 设置当前图像参数
         public void SetParaInfo()
         {
-            lblKV.Text = Kv;
             lblMag.Text = Mag;
             lblContent.Text = Content;
-
-            lblAutoKV.Text = "";
+            
             lblAutoMag.Text = "";
             lblAutoContent.Text = "";
         }
 
         public void SetAutoParaInfo()
         {
-            lblAutoKV.Text = AutoKv;
             lblAutoMag.Text = AutoMag;
             lblAutoContent.Text = AutoContent;
         } 

+ 80 - 91
HOZProject/FormUCMain.Designer.cs

@@ -146,7 +146,6 @@
             this.btnConnect = new System.Windows.Forms.Button();
             this.btnGetImage = new System.Windows.Forms.Button();
             this.btnStop = new System.Windows.Forms.Button();
-            this.button9 = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.pichide)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.picexit)).BeginInit();
             this.panel1.SuspendLayout();
@@ -179,7 +178,7 @@
             this.pichide.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pichide.Image = global::HOZProject.Properties.Resources.Min_Gray;
             this.pichide.Location = new System.Drawing.Point(985, 9);
-            this.pichide.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pichide.Margin = new System.Windows.Forms.Padding(4);
             this.pichide.Name = "pichide";
             this.pichide.Size = new System.Drawing.Size(13, 13);
             this.pichide.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -195,7 +194,7 @@
             this.picexit.Cursor = System.Windows.Forms.Cursors.Hand;
             this.picexit.Image = global::HOZProject.Properties.Resources.exit_Gray;
             this.picexit.Location = new System.Drawing.Point(1001, 9);
-            this.picexit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.picexit.Margin = new System.Windows.Forms.Padding(4);
             this.picexit.Name = "picexit";
             this.picexit.Size = new System.Drawing.Size(13, 13);
             this.picexit.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -214,7 +213,7 @@
             this.panel1.Controls.Add(this.lblFocus);
             this.panel1.Controls.Add(this.btnenlargeGet);
             this.panel1.Location = new System.Drawing.Point(30, 186);
-            this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel1.Margin = new System.Windows.Forms.Padding(2);
             this.panel1.Name = "panel1";
             this.panel1.Size = new System.Drawing.Size(183, 30);
             this.panel1.TabIndex = 58;
@@ -227,7 +226,7 @@
             this.btnenlargeSet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnenlargeSet.ForeColor = System.Drawing.Color.Black;
             this.btnenlargeSet.Location = new System.Drawing.Point(149, 3);
-            this.btnenlargeSet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnenlargeSet.Margin = new System.Windows.Forms.Padding(2);
             this.btnenlargeSet.Name = "btnenlargeSet";
             this.btnenlargeSet.Size = new System.Drawing.Size(32, 24);
             this.btnenlargeSet.TabIndex = 60;
@@ -239,7 +238,7 @@
             // txtenlarge
             // 
             this.txtenlarge.Location = new System.Drawing.Point(38, 5);
-            this.txtenlarge.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtenlarge.Margin = new System.Windows.Forms.Padding(2);
             this.txtenlarge.Name = "txtenlarge";
             this.txtenlarge.Size = new System.Drawing.Size(77, 21);
             this.txtenlarge.TabIndex = 1;
@@ -282,7 +281,7 @@
             this.panel2.Controls.Add(this.label1);
             this.panel2.Controls.Add(this.btnBrightnessGet);
             this.panel2.Location = new System.Drawing.Point(223, 186);
-            this.panel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel2.Margin = new System.Windows.Forms.Padding(2);
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(183, 30);
             this.panel2.TabIndex = 58;
@@ -295,7 +294,7 @@
             this.btnBrightnessSet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnBrightnessSet.ForeColor = System.Drawing.Color.Black;
             this.btnBrightnessSet.Location = new System.Drawing.Point(149, 3);
-            this.btnBrightnessSet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnBrightnessSet.Margin = new System.Windows.Forms.Padding(2);
             this.btnBrightnessSet.Name = "btnBrightnessSet";
             this.btnBrightnessSet.Size = new System.Drawing.Size(32, 24);
             this.btnBrightnessSet.TabIndex = 60;
@@ -307,7 +306,7 @@
             // txtBrightness
             // 
             this.txtBrightness.Location = new System.Drawing.Point(38, 5);
-            this.txtBrightness.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtBrightness.Margin = new System.Windows.Forms.Padding(2);
             this.txtBrightness.Name = "txtBrightness";
             this.txtBrightness.Size = new System.Drawing.Size(77, 21);
             this.txtBrightness.TabIndex = 59;
@@ -332,7 +331,7 @@
             this.btnBrightnessGet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnBrightnessGet.ForeColor = System.Drawing.Color.White;
             this.btnBrightnessGet.Location = new System.Drawing.Point(119, 3);
-            this.btnBrightnessGet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnBrightnessGet.Margin = new System.Windows.Forms.Padding(2);
             this.btnBrightnessGet.Name = "btnBrightnessGet";
             this.btnBrightnessGet.Size = new System.Drawing.Size(32, 24);
             this.btnBrightnessGet.TabIndex = 59;
@@ -350,7 +349,7 @@
             this.panel3.Controls.Add(this.label2);
             this.panel3.Controls.Add(this.btnTiltAngleGet);
             this.panel3.Location = new System.Drawing.Point(416, 186);
-            this.panel3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel3.Margin = new System.Windows.Forms.Padding(2);
             this.panel3.Name = "panel3";
             this.panel3.Size = new System.Drawing.Size(183, 30);
             this.panel3.TabIndex = 58;
@@ -363,7 +362,7 @@
             this.btnTiltAngleSet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnTiltAngleSet.ForeColor = System.Drawing.Color.Black;
             this.btnTiltAngleSet.Location = new System.Drawing.Point(149, 3);
-            this.btnTiltAngleSet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnTiltAngleSet.Margin = new System.Windows.Forms.Padding(2);
             this.btnTiltAngleSet.Name = "btnTiltAngleSet";
             this.btnTiltAngleSet.Size = new System.Drawing.Size(32, 24);
             this.btnTiltAngleSet.TabIndex = 60;
@@ -375,7 +374,7 @@
             // txtTiltAngle
             // 
             this.txtTiltAngle.Location = new System.Drawing.Point(59, 5);
-            this.txtTiltAngle.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtTiltAngle.Margin = new System.Windows.Forms.Padding(2);
             this.txtTiltAngle.Name = "txtTiltAngle";
             this.txtTiltAngle.Size = new System.Drawing.Size(56, 21);
             this.txtTiltAngle.TabIndex = 59;
@@ -400,7 +399,7 @@
             this.btnTiltAngleGet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnTiltAngleGet.ForeColor = System.Drawing.Color.White;
             this.btnTiltAngleGet.Location = new System.Drawing.Point(119, 3);
-            this.btnTiltAngleGet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnTiltAngleGet.Margin = new System.Windows.Forms.Padding(2);
             this.btnTiltAngleGet.Name = "btnTiltAngleGet";
             this.btnTiltAngleGet.Size = new System.Drawing.Size(32, 24);
             this.btnTiltAngleGet.TabIndex = 59;
@@ -418,7 +417,7 @@
             this.panel4.Controls.Add(this.label3);
             this.panel4.Controls.Add(this.btnAstigmatismXGet);
             this.panel4.Location = new System.Drawing.Point(609, 186);
-            this.panel4.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel4.Margin = new System.Windows.Forms.Padding(2);
             this.panel4.Name = "panel4";
             this.panel4.Size = new System.Drawing.Size(183, 30);
             this.panel4.TabIndex = 58;
@@ -431,7 +430,7 @@
             this.btnAstigmatismXSet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnAstigmatismXSet.ForeColor = System.Drawing.Color.Black;
             this.btnAstigmatismXSet.Location = new System.Drawing.Point(149, 3);
-            this.btnAstigmatismXSet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnAstigmatismXSet.Margin = new System.Windows.Forms.Padding(2);
             this.btnAstigmatismXSet.Name = "btnAstigmatismXSet";
             this.btnAstigmatismXSet.Size = new System.Drawing.Size(32, 24);
             this.btnAstigmatismXSet.TabIndex = 60;
@@ -443,7 +442,7 @@
             // txtAstigmatismX
             // 
             this.txtAstigmatismX.Location = new System.Drawing.Point(60, 5);
-            this.txtAstigmatismX.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtAstigmatismX.Margin = new System.Windows.Forms.Padding(2);
             this.txtAstigmatismX.Name = "txtAstigmatismX";
             this.txtAstigmatismX.Size = new System.Drawing.Size(55, 21);
             this.txtAstigmatismX.TabIndex = 59;
@@ -468,7 +467,7 @@
             this.btnAstigmatismXGet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnAstigmatismXGet.ForeColor = System.Drawing.Color.White;
             this.btnAstigmatismXGet.Location = new System.Drawing.Point(119, 3);
-            this.btnAstigmatismXGet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnAstigmatismXGet.Margin = new System.Windows.Forms.Padding(2);
             this.btnAstigmatismXGet.Name = "btnAstigmatismXGet";
             this.btnAstigmatismXGet.Size = new System.Drawing.Size(32, 24);
             this.btnAstigmatismXGet.TabIndex = 59;
@@ -485,7 +484,7 @@
             this.panel5.Controls.Add(this.label4);
             this.panel5.Controls.Add(this.btnPixelSizeGet);
             this.panel5.Location = new System.Drawing.Point(802, 186);
-            this.panel5.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel5.Margin = new System.Windows.Forms.Padding(2);
             this.panel5.Name = "panel5";
             this.panel5.Size = new System.Drawing.Size(156, 30);
             this.panel5.TabIndex = 58;
@@ -493,7 +492,7 @@
             // txtPixelSize
             // 
             this.txtPixelSize.Location = new System.Drawing.Point(60, 5);
-            this.txtPixelSize.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtPixelSize.Margin = new System.Windows.Forms.Padding(2);
             this.txtPixelSize.Name = "txtPixelSize";
             this.txtPixelSize.Size = new System.Drawing.Size(55, 21);
             this.txtPixelSize.TabIndex = 59;
@@ -518,7 +517,7 @@
             this.btnPixelSizeGet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnPixelSizeGet.ForeColor = System.Drawing.Color.White;
             this.btnPixelSizeGet.Location = new System.Drawing.Point(119, 3);
-            this.btnPixelSizeGet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnPixelSizeGet.Margin = new System.Windows.Forms.Padding(2);
             this.btnPixelSizeGet.Name = "btnPixelSizeGet";
             this.btnPixelSizeGet.Size = new System.Drawing.Size(32, 24);
             this.btnPixelSizeGet.TabIndex = 59;
@@ -536,7 +535,7 @@
             this.panel8.Controls.Add(this.label6);
             this.panel8.Controls.Add(this.btnAstigmatismYGet);
             this.panel8.Location = new System.Drawing.Point(609, 227);
-            this.panel8.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel8.Margin = new System.Windows.Forms.Padding(2);
             this.panel8.Name = "panel8";
             this.panel8.Size = new System.Drawing.Size(183, 30);
             this.panel8.TabIndex = 68;
@@ -549,7 +548,7 @@
             this.btnAstigmatismYSet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnAstigmatismYSet.ForeColor = System.Drawing.Color.Black;
             this.btnAstigmatismYSet.Location = new System.Drawing.Point(149, 3);
-            this.btnAstigmatismYSet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnAstigmatismYSet.Margin = new System.Windows.Forms.Padding(2);
             this.btnAstigmatismYSet.Name = "btnAstigmatismYSet";
             this.btnAstigmatismYSet.Size = new System.Drawing.Size(32, 24);
             this.btnAstigmatismYSet.TabIndex = 60;
@@ -561,7 +560,7 @@
             // txtAstigmatismY
             // 
             this.txtAstigmatismY.Location = new System.Drawing.Point(60, 5);
-            this.txtAstigmatismY.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtAstigmatismY.Margin = new System.Windows.Forms.Padding(2);
             this.txtAstigmatismY.Name = "txtAstigmatismY";
             this.txtAstigmatismY.Size = new System.Drawing.Size(55, 21);
             this.txtAstigmatismY.TabIndex = 59;
@@ -586,7 +585,7 @@
             this.btnAstigmatismYGet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnAstigmatismYGet.ForeColor = System.Drawing.Color.White;
             this.btnAstigmatismYGet.Location = new System.Drawing.Point(119, 3);
-            this.btnAstigmatismYGet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnAstigmatismYGet.Margin = new System.Windows.Forms.Padding(2);
             this.btnAstigmatismYGet.Name = "btnAstigmatismYGet";
             this.btnAstigmatismYGet.Size = new System.Drawing.Size(32, 24);
             this.btnAstigmatismYGet.TabIndex = 59;
@@ -604,7 +603,7 @@
             this.panel9.Controls.Add(this.label7);
             this.panel9.Controls.Add(this.btnScanRotationGet);
             this.panel9.Location = new System.Drawing.Point(416, 227);
-            this.panel9.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel9.Margin = new System.Windows.Forms.Padding(2);
             this.panel9.Name = "panel9";
             this.panel9.Size = new System.Drawing.Size(183, 30);
             this.panel9.TabIndex = 69;
@@ -617,7 +616,7 @@
             this.btnScanRotationSet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnScanRotationSet.ForeColor = System.Drawing.Color.Black;
             this.btnScanRotationSet.Location = new System.Drawing.Point(149, 3);
-            this.btnScanRotationSet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnScanRotationSet.Margin = new System.Windows.Forms.Padding(2);
             this.btnScanRotationSet.Name = "btnScanRotationSet";
             this.btnScanRotationSet.Size = new System.Drawing.Size(32, 24);
             this.btnScanRotationSet.TabIndex = 60;
@@ -629,7 +628,7 @@
             // txtScanRotation
             // 
             this.txtScanRotation.Location = new System.Drawing.Point(59, 5);
-            this.txtScanRotation.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtScanRotation.Margin = new System.Windows.Forms.Padding(2);
             this.txtScanRotation.Name = "txtScanRotation";
             this.txtScanRotation.Size = new System.Drawing.Size(56, 21);
             this.txtScanRotation.TabIndex = 59;
@@ -654,7 +653,7 @@
             this.btnScanRotationGet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnScanRotationGet.ForeColor = System.Drawing.Color.White;
             this.btnScanRotationGet.Location = new System.Drawing.Point(119, 3);
-            this.btnScanRotationGet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnScanRotationGet.Margin = new System.Windows.Forms.Padding(2);
             this.btnScanRotationGet.Name = "btnScanRotationGet";
             this.btnScanRotationGet.Size = new System.Drawing.Size(32, 24);
             this.btnScanRotationGet.TabIndex = 59;
@@ -672,7 +671,7 @@
             this.panel10.Controls.Add(this.label8);
             this.panel10.Controls.Add(this.btnContrastGet);
             this.panel10.Location = new System.Drawing.Point(223, 227);
-            this.panel10.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel10.Margin = new System.Windows.Forms.Padding(2);
             this.panel10.Name = "panel10";
             this.panel10.Size = new System.Drawing.Size(183, 30);
             this.panel10.TabIndex = 70;
@@ -685,7 +684,7 @@
             this.btnContrastSet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnContrastSet.ForeColor = System.Drawing.Color.Black;
             this.btnContrastSet.Location = new System.Drawing.Point(149, 3);
-            this.btnContrastSet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnContrastSet.Margin = new System.Windows.Forms.Padding(2);
             this.btnContrastSet.Name = "btnContrastSet";
             this.btnContrastSet.Size = new System.Drawing.Size(32, 24);
             this.btnContrastSet.TabIndex = 60;
@@ -697,7 +696,7 @@
             // txtContrast
             // 
             this.txtContrast.Location = new System.Drawing.Point(47, 5);
-            this.txtContrast.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtContrast.Margin = new System.Windows.Forms.Padding(2);
             this.txtContrast.Name = "txtContrast";
             this.txtContrast.Size = new System.Drawing.Size(68, 21);
             this.txtContrast.TabIndex = 59;
@@ -722,7 +721,7 @@
             this.btnContrastGet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnContrastGet.ForeColor = System.Drawing.Color.White;
             this.btnContrastGet.Location = new System.Drawing.Point(119, 3);
-            this.btnContrastGet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnContrastGet.Margin = new System.Windows.Forms.Padding(2);
             this.btnContrastGet.Name = "btnContrastGet";
             this.btnContrastGet.Size = new System.Drawing.Size(32, 24);
             this.btnContrastGet.TabIndex = 59;
@@ -740,7 +739,7 @@
             this.panel11.Controls.Add(this.label9);
             this.panel11.Controls.Add(this.btnWDGet);
             this.panel11.Location = new System.Drawing.Point(30, 227);
-            this.panel11.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel11.Margin = new System.Windows.Forms.Padding(2);
             this.panel11.Name = "panel11";
             this.panel11.Size = new System.Drawing.Size(183, 30);
             this.panel11.TabIndex = 71;
@@ -753,7 +752,7 @@
             this.btnWDSet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnWDSet.ForeColor = System.Drawing.Color.Black;
             this.btnWDSet.Location = new System.Drawing.Point(149, 3);
-            this.btnWDSet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnWDSet.Margin = new System.Windows.Forms.Padding(2);
             this.btnWDSet.Name = "btnWDSet";
             this.btnWDSet.Size = new System.Drawing.Size(32, 24);
             this.btnWDSet.TabIndex = 60;
@@ -765,7 +764,7 @@
             // txtWD
             // 
             this.txtWD.Location = new System.Drawing.Point(38, 5);
-            this.txtWD.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtWD.Margin = new System.Windows.Forms.Padding(2);
             this.txtWD.Name = "txtWD";
             this.txtWD.Size = new System.Drawing.Size(77, 21);
             this.txtWD.TabIndex = 59;
@@ -790,7 +789,7 @@
             this.btnWDGet.Font = new System.Drawing.Font("宋体", 10F);
             this.btnWDGet.ForeColor = System.Drawing.Color.White;
             this.btnWDGet.Location = new System.Drawing.Point(119, 3);
-            this.btnWDGet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnWDGet.Margin = new System.Windows.Forms.Padding(2);
             this.btnWDGet.Name = "btnWDGet";
             this.btnWDGet.Size = new System.Drawing.Size(32, 24);
             this.btnWDGet.TabIndex = 59;
@@ -808,7 +807,7 @@
             this.panel7.Controls.Add(this.label5);
             this.panel7.Controls.Add(this.btnStageGetM);
             this.panel7.Location = new System.Drawing.Point(416, 322);
-            this.panel7.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel7.Margin = new System.Windows.Forms.Padding(2);
             this.panel7.Name = "panel7";
             this.panel7.Size = new System.Drawing.Size(183, 30);
             this.panel7.TabIndex = 75;
@@ -821,7 +820,7 @@
             this.btnStageSetM.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageSetM.ForeColor = System.Drawing.Color.Black;
             this.btnStageSetM.Location = new System.Drawing.Point(149, 3);
-            this.btnStageSetM.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageSetM.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageSetM.Name = "btnStageSetM";
             this.btnStageSetM.Size = new System.Drawing.Size(32, 24);
             this.btnStageSetM.TabIndex = 60;
@@ -833,7 +832,7 @@
             // txtStageM
             // 
             this.txtStageM.Location = new System.Drawing.Point(68, 5);
-            this.txtStageM.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtStageM.Margin = new System.Windows.Forms.Padding(2);
             this.txtStageM.Name = "txtStageM";
             this.txtStageM.Size = new System.Drawing.Size(47, 21);
             this.txtStageM.TabIndex = 59;
@@ -858,7 +857,7 @@
             this.btnStageGetM.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageGetM.ForeColor = System.Drawing.Color.White;
             this.btnStageGetM.Location = new System.Drawing.Point(119, 3);
-            this.btnStageGetM.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageGetM.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageGetM.Name = "btnStageGetM";
             this.btnStageGetM.Size = new System.Drawing.Size(32, 24);
             this.btnStageGetM.TabIndex = 59;
@@ -876,7 +875,7 @@
             this.panel12.Controls.Add(this.label10);
             this.panel12.Controls.Add(this.btnStageGetR);
             this.panel12.Location = new System.Drawing.Point(223, 322);
-            this.panel12.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel12.Margin = new System.Windows.Forms.Padding(2);
             this.panel12.Name = "panel12";
             this.panel12.Size = new System.Drawing.Size(183, 30);
             this.panel12.TabIndex = 76;
@@ -889,7 +888,7 @@
             this.btnStageSetR.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageSetR.ForeColor = System.Drawing.Color.Black;
             this.btnStageSetR.Location = new System.Drawing.Point(149, 3);
-            this.btnStageSetR.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageSetR.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageSetR.Name = "btnStageSetR";
             this.btnStageSetR.Size = new System.Drawing.Size(32, 24);
             this.btnStageSetR.TabIndex = 60;
@@ -901,7 +900,7 @@
             // txtStageR
             // 
             this.txtStageR.Location = new System.Drawing.Point(68, 5);
-            this.txtStageR.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtStageR.Margin = new System.Windows.Forms.Padding(2);
             this.txtStageR.Name = "txtStageR";
             this.txtStageR.Size = new System.Drawing.Size(47, 21);
             this.txtStageR.TabIndex = 59;
@@ -926,7 +925,7 @@
             this.btnStageGetR.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageGetR.ForeColor = System.Drawing.Color.White;
             this.btnStageGetR.Location = new System.Drawing.Point(119, 3);
-            this.btnStageGetR.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageGetR.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageGetR.Name = "btnStageGetR";
             this.btnStageGetR.Size = new System.Drawing.Size(32, 24);
             this.btnStageGetR.TabIndex = 59;
@@ -944,7 +943,7 @@
             this.panel13.Controls.Add(this.label11);
             this.panel13.Controls.Add(this.btnStageGetT);
             this.panel13.Location = new System.Drawing.Point(30, 322);
-            this.panel13.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel13.Margin = new System.Windows.Forms.Padding(2);
             this.panel13.Name = "panel13";
             this.panel13.Size = new System.Drawing.Size(183, 30);
             this.panel13.TabIndex = 77;
@@ -957,7 +956,7 @@
             this.btnStageSetT.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageSetT.ForeColor = System.Drawing.Color.Black;
             this.btnStageSetT.Location = new System.Drawing.Point(149, 3);
-            this.btnStageSetT.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageSetT.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageSetT.Name = "btnStageSetT";
             this.btnStageSetT.Size = new System.Drawing.Size(32, 24);
             this.btnStageSetT.TabIndex = 60;
@@ -969,7 +968,7 @@
             // txtStageT
             // 
             this.txtStageT.Location = new System.Drawing.Point(68, 5);
-            this.txtStageT.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtStageT.Margin = new System.Windows.Forms.Padding(2);
             this.txtStageT.Name = "txtStageT";
             this.txtStageT.Size = new System.Drawing.Size(47, 21);
             this.txtStageT.TabIndex = 59;
@@ -994,7 +993,7 @@
             this.btnStageGetT.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageGetT.ForeColor = System.Drawing.Color.White;
             this.btnStageGetT.Location = new System.Drawing.Point(119, 3);
-            this.btnStageGetT.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageGetT.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageGetT.Name = "btnStageGetT";
             this.btnStageGetT.Size = new System.Drawing.Size(32, 24);
             this.btnStageGetT.TabIndex = 59;
@@ -1012,7 +1011,7 @@
             this.panel14.Controls.Add(this.label12);
             this.panel14.Controls.Add(this.btnStageGetZ);
             this.panel14.Location = new System.Drawing.Point(416, 281);
-            this.panel14.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel14.Margin = new System.Windows.Forms.Padding(2);
             this.panel14.Name = "panel14";
             this.panel14.Size = new System.Drawing.Size(183, 30);
             this.panel14.TabIndex = 72;
@@ -1025,7 +1024,7 @@
             this.btnStageSetZ.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageSetZ.ForeColor = System.Drawing.Color.Black;
             this.btnStageSetZ.Location = new System.Drawing.Point(149, 3);
-            this.btnStageSetZ.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageSetZ.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageSetZ.Name = "btnStageSetZ";
             this.btnStageSetZ.Size = new System.Drawing.Size(32, 24);
             this.btnStageSetZ.TabIndex = 60;
@@ -1037,7 +1036,7 @@
             // txtStageZ
             // 
             this.txtStageZ.Location = new System.Drawing.Point(68, 5);
-            this.txtStageZ.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtStageZ.Margin = new System.Windows.Forms.Padding(2);
             this.txtStageZ.Name = "txtStageZ";
             this.txtStageZ.Size = new System.Drawing.Size(47, 21);
             this.txtStageZ.TabIndex = 59;
@@ -1062,7 +1061,7 @@
             this.btnStageGetZ.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageGetZ.ForeColor = System.Drawing.Color.White;
             this.btnStageGetZ.Location = new System.Drawing.Point(119, 3);
-            this.btnStageGetZ.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageGetZ.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageGetZ.Name = "btnStageGetZ";
             this.btnStageGetZ.Size = new System.Drawing.Size(32, 24);
             this.btnStageGetZ.TabIndex = 59;
@@ -1080,7 +1079,7 @@
             this.panel15.Controls.Add(this.label13);
             this.panel15.Controls.Add(this.btnStageGetY);
             this.panel15.Location = new System.Drawing.Point(223, 281);
-            this.panel15.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel15.Margin = new System.Windows.Forms.Padding(2);
             this.panel15.Name = "panel15";
             this.panel15.Size = new System.Drawing.Size(183, 30);
             this.panel15.TabIndex = 73;
@@ -1093,7 +1092,7 @@
             this.btnStageSetY.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageSetY.ForeColor = System.Drawing.Color.Black;
             this.btnStageSetY.Location = new System.Drawing.Point(149, 3);
-            this.btnStageSetY.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageSetY.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageSetY.Name = "btnStageSetY";
             this.btnStageSetY.Size = new System.Drawing.Size(32, 24);
             this.btnStageSetY.TabIndex = 60;
@@ -1105,7 +1104,7 @@
             // txtStageY
             // 
             this.txtStageY.Location = new System.Drawing.Point(68, 5);
-            this.txtStageY.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtStageY.Margin = new System.Windows.Forms.Padding(2);
             this.txtStageY.Name = "txtStageY";
             this.txtStageY.Size = new System.Drawing.Size(47, 21);
             this.txtStageY.TabIndex = 59;
@@ -1130,7 +1129,7 @@
             this.btnStageGetY.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageGetY.ForeColor = System.Drawing.Color.White;
             this.btnStageGetY.Location = new System.Drawing.Point(119, 3);
-            this.btnStageGetY.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageGetY.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageGetY.Name = "btnStageGetY";
             this.btnStageGetY.Size = new System.Drawing.Size(32, 24);
             this.btnStageGetY.TabIndex = 59;
@@ -1148,7 +1147,7 @@
             this.panel16.Controls.Add(this.label14);
             this.panel16.Controls.Add(this.btnStageGetX);
             this.panel16.Location = new System.Drawing.Point(30, 281);
-            this.panel16.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel16.Margin = new System.Windows.Forms.Padding(2);
             this.panel16.Name = "panel16";
             this.panel16.Size = new System.Drawing.Size(183, 30);
             this.panel16.TabIndex = 74;
@@ -1161,7 +1160,7 @@
             this.btnStageSetX.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageSetX.ForeColor = System.Drawing.Color.Black;
             this.btnStageSetX.Location = new System.Drawing.Point(149, 3);
-            this.btnStageSetX.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageSetX.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageSetX.Name = "btnStageSetX";
             this.btnStageSetX.Size = new System.Drawing.Size(32, 24);
             this.btnStageSetX.TabIndex = 60;
@@ -1173,7 +1172,7 @@
             // txtStageX
             // 
             this.txtStageX.Location = new System.Drawing.Point(68, 5);
-            this.txtStageX.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtStageX.Margin = new System.Windows.Forms.Padding(2);
             this.txtStageX.Name = "txtStageX";
             this.txtStageX.Size = new System.Drawing.Size(47, 21);
             this.txtStageX.TabIndex = 59;
@@ -1198,7 +1197,7 @@
             this.btnStageGetX.Font = new System.Drawing.Font("宋体", 10F);
             this.btnStageGetX.ForeColor = System.Drawing.Color.White;
             this.btnStageGetX.Location = new System.Drawing.Point(119, 3);
-            this.btnStageGetX.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnStageGetX.Margin = new System.Windows.Forms.Padding(2);
             this.btnStageGetX.Name = "btnStageGetX";
             this.btnStageGetX.Size = new System.Drawing.Size(32, 24);
             this.btnStageGetX.TabIndex = 59;
@@ -1326,7 +1325,7 @@
             this.pbHT.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbHT.Image = global::HOZProject.Properties.Resources.OFF;
             this.pbHT.Location = new System.Drawing.Point(950, 154);
-            this.pbHT.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.pbHT.Margin = new System.Windows.Forms.Padding(2);
             this.pbHT.Name = "pbHT";
             this.pbHT.Size = new System.Drawing.Size(48, 19);
             this.pbHT.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -1355,7 +1354,7 @@
             this.panel6.Controls.Add(this.comboBox1);
             this.panel6.Controls.Add(this.label17);
             this.panel6.Location = new System.Drawing.Point(30, 412);
-            this.panel6.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel6.Margin = new System.Windows.Forms.Padding(2);
             this.panel6.Name = "panel6";
             this.panel6.Size = new System.Drawing.Size(262, 30);
             this.panel6.TabIndex = 77;
@@ -1368,7 +1367,7 @@
             this.button1.Font = new System.Drawing.Font("宋体", 10F);
             this.button1.ForeColor = System.Drawing.Color.White;
             this.button1.Location = new System.Drawing.Point(184, 3);
-            this.button1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.button1.Margin = new System.Windows.Forms.Padding(2);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(76, 24);
             this.button1.TabIndex = 88;
@@ -1406,7 +1405,7 @@
             this.panel20.Controls.Add(this.label20);
             this.panel20.Controls.Add(this.button4);
             this.panel20.Location = new System.Drawing.Point(30, 495);
-            this.panel20.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel20.Margin = new System.Windows.Forms.Padding(2);
             this.panel20.Name = "panel20";
             this.panel20.Size = new System.Drawing.Size(183, 30);
             this.panel20.TabIndex = 87;
@@ -1419,7 +1418,7 @@
             this.button3.Font = new System.Drawing.Font("宋体", 10F);
             this.button3.ForeColor = System.Drawing.Color.Black;
             this.button3.Location = new System.Drawing.Point(149, 3);
-            this.button3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.button3.Margin = new System.Windows.Forms.Padding(2);
             this.button3.Name = "button3";
             this.button3.Size = new System.Drawing.Size(32, 24);
             this.button3.TabIndex = 60;
@@ -1430,7 +1429,7 @@
             // textBox3
             // 
             this.textBox3.Location = new System.Drawing.Point(68, 5);
-            this.textBox3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.textBox3.Margin = new System.Windows.Forms.Padding(2);
             this.textBox3.Name = "textBox3";
             this.textBox3.Size = new System.Drawing.Size(47, 21);
             this.textBox3.TabIndex = 59;
@@ -1455,7 +1454,7 @@
             this.button4.Font = new System.Drawing.Font("宋体", 10F);
             this.button4.ForeColor = System.Drawing.Color.White;
             this.button4.Location = new System.Drawing.Point(119, 3);
-            this.button4.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.button4.Margin = new System.Windows.Forms.Padding(2);
             this.button4.Name = "button4";
             this.button4.Size = new System.Drawing.Size(32, 24);
             this.button4.TabIndex = 59;
@@ -1472,7 +1471,7 @@
             this.panel17.Controls.Add(this.textBox1);
             this.panel17.Controls.Add(this.label16);
             this.panel17.Location = new System.Drawing.Point(299, 412);
-            this.panel17.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel17.Margin = new System.Windows.Forms.Padding(2);
             this.panel17.Name = "panel17";
             this.panel17.Size = new System.Drawing.Size(450, 30);
             this.panel17.TabIndex = 87;
@@ -1485,7 +1484,7 @@
             this.button6.Font = new System.Drawing.Font("宋体", 10F);
             this.button6.ForeColor = System.Drawing.Color.White;
             this.button6.Location = new System.Drawing.Point(372, 3);
-            this.button6.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.button6.Margin = new System.Windows.Forms.Padding(2);
             this.button6.Name = "button6";
             this.button6.Size = new System.Drawing.Size(76, 24);
             this.button6.TabIndex = 89;
@@ -1500,7 +1499,7 @@
             this.button5.Font = new System.Drawing.Font("宋体", 9F);
             this.button5.ForeColor = System.Drawing.Color.Black;
             this.button5.Location = new System.Drawing.Point(337, 3);
-            this.button5.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.button5.Margin = new System.Windows.Forms.Padding(2);
             this.button5.Name = "button5";
             this.button5.Size = new System.Drawing.Size(32, 24);
             this.button5.TabIndex = 60;
@@ -1511,7 +1510,7 @@
             // textBox1
             // 
             this.textBox1.Location = new System.Drawing.Point(66, 5);
-            this.textBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.textBox1.Margin = new System.Windows.Forms.Padding(2);
             this.textBox1.Name = "textBox1";
             this.textBox1.Size = new System.Drawing.Size(270, 21);
             this.textBox1.TabIndex = 59;
@@ -1537,7 +1536,7 @@
             this.panel18.Controls.Add(this.textBox2);
             this.panel18.Controls.Add(this.label18);
             this.panel18.Location = new System.Drawing.Point(492, 495);
-            this.panel18.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel18.Margin = new System.Windows.Forms.Padding(2);
             this.panel18.Name = "panel18";
             this.panel18.Size = new System.Drawing.Size(450, 30);
             this.panel18.TabIndex = 89;
@@ -1550,7 +1549,7 @@
             this.button2.Font = new System.Drawing.Font("宋体", 10F);
             this.button2.ForeColor = System.Drawing.Color.White;
             this.button2.Location = new System.Drawing.Point(372, 3);
-            this.button2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.button2.Margin = new System.Windows.Forms.Padding(2);
             this.button2.Name = "button2";
             this.button2.Size = new System.Drawing.Size(76, 24);
             this.button2.TabIndex = 89;
@@ -1565,7 +1564,7 @@
             this.button7.Font = new System.Drawing.Font("宋体", 9F);
             this.button7.ForeColor = System.Drawing.Color.Black;
             this.button7.Location = new System.Drawing.Point(337, 3);
-            this.button7.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.button7.Margin = new System.Windows.Forms.Padding(2);
             this.button7.Name = "button7";
             this.button7.Size = new System.Drawing.Size(32, 24);
             this.button7.TabIndex = 60;
@@ -1576,7 +1575,7 @@
             // textBox2
             // 
             this.textBox2.Location = new System.Drawing.Point(66, 5);
-            this.textBox2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.textBox2.Margin = new System.Windows.Forms.Padding(2);
             this.textBox2.Name = "textBox2";
             this.textBox2.Size = new System.Drawing.Size(270, 21);
             this.textBox2.TabIndex = 59;
@@ -1601,7 +1600,7 @@
             this.panel19.Controls.Add(this.comboBox2);
             this.panel19.Controls.Add(this.label19);
             this.panel19.Location = new System.Drawing.Point(223, 495);
-            this.panel19.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel19.Margin = new System.Windows.Forms.Padding(2);
             this.panel19.Name = "panel19";
             this.panel19.Size = new System.Drawing.Size(262, 30);
             this.panel19.TabIndex = 88;
@@ -1614,7 +1613,7 @@
             this.button8.Font = new System.Drawing.Font("宋体", 10F);
             this.button8.ForeColor = System.Drawing.Color.White;
             this.button8.Location = new System.Drawing.Point(184, 3);
-            this.button8.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.button8.Margin = new System.Windows.Forms.Padding(2);
             this.button8.Name = "button8";
             this.button8.Size = new System.Drawing.Size(76, 24);
             this.button8.TabIndex = 88;
@@ -1678,7 +1677,7 @@
             // txtMoveStageY
             // 
             this.txtMoveStageY.Location = new System.Drawing.Point(32, 42);
-            this.txtMoveStageY.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtMoveStageY.Margin = new System.Windows.Forms.Padding(2);
             this.txtMoveStageY.Name = "txtMoveStageY";
             this.txtMoveStageY.Size = new System.Drawing.Size(74, 21);
             this.txtMoveStageY.TabIndex = 62;
@@ -1698,7 +1697,7 @@
             // txtMoveStageX
             // 
             this.txtMoveStageX.Location = new System.Drawing.Point(32, 17);
-            this.txtMoveStageX.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.txtMoveStageX.Margin = new System.Windows.Forms.Padding(2);
             this.txtMoveStageX.Name = "txtMoveStageX";
             this.txtMoveStageX.Size = new System.Drawing.Size(74, 21);
             this.txtMoveStageX.TabIndex = 60;
@@ -1758,14 +1757,6 @@
             this.btnStop.UseVisualStyleBackColor = false;
             this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
             // 
-            // button9
-            // 
-            this.button9.Location = new System.Drawing.Point(589, 581);
-            this.button9.Name = "button9";
-            this.button9.Size = new System.Drawing.Size(75, 23);
-            this.button9.TabIndex = 92;
-            this.button9.UseVisualStyleBackColor = true;
-            // 
             // FormUCMain
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1774,7 +1765,6 @@
             this.BackgroundImage = global::HOZProject.Properties.Resources.UCMain;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
             this.ClientSize = new System.Drawing.Size(1024, 680);
-            this.Controls.Add(this.button9);
             this.Controls.Add(this.btnGetImage);
             this.Controls.Add(this.btnConnect);
             this.Controls.Add(this.groupBox1);
@@ -1813,7 +1803,7 @@
             this.Controls.Add(this.picexit);
             this.DoubleBuffered = true;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "FormUCMain";
             this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
@@ -1991,6 +1981,5 @@
         private System.Windows.Forms.Button btnConnect;
         private System.Windows.Forms.Button btnGetImage;
         private System.Windows.Forms.Button btnStop;
-        private System.Windows.Forms.Button button9;
     }
 }

+ 29 - 21
HOZProject/FormUCMain.cs

@@ -4,6 +4,7 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading;
@@ -752,10 +753,12 @@ namespace HOZProject
             bool imageResult = iSEM.GrabImage(m_ImgFileSavePath, 0, 0, m_ImgWidth, m_ImgHeight, 0);
             if (imageResult)
             {
-                Bitmap bitmap = new Bitmap(m_ImgFileSavePath);
+                FileStream fileStream = new FileStream(m_ImgFileSavePath, FileMode.Open, FileAccess.Read);
                 fShowImage.Width = fShowImage.Width / 2;
                 //设置当前图像与参数
-                fShowImage.pbImage.Image = (Image)bitmap;
+                fShowImage.pbImage.Image = Image.FromStream(fileStream);
+                fileStream.Close();
+                fileStream.Dispose();
                 fShowImage.Mag = "放大倍数:" + f_Mag;
                 fShowImage.Content = "焦距:" + f_WD;
                 fShowImage.SetParaInfo();
@@ -784,19 +787,15 @@ namespace HOZProject
             bool imageResult = iSEM.GrabImage(m_ImgFileSavePath, 0, 0, m_ImgWidth, m_ImgHeight, 0);
             if (imageResult)
             {
-                Bitmap bitmap = new Bitmap(m_ImgFileSavePath);
+                FileStream fileStream = new FileStream(m_ImgFileSavePath, FileMode.Open, FileAccess.Read);
+                fShowImage.pbImage.Image = Image.FromStream(fileStream);
+                fileStream.Close();
+                fileStream.Dispose();
                 //设置当前图像与参数
-                fShowImage.pbImage.Image = (Image)bitmap;
                 fShowImage.Mag = "放大倍数:" + f_Mag;
                 fShowImage.Content = "焦距:" + f_WD;
                 fShowImage.SetParaInfo();
                 fShowImage.Show();
-                //float result = iSEM.GetAutoFunction();
-                //if (result > 0)
-                //{
-                //    Thread threadImg = new Thread(new ThreadStart(GetAutoWDImage));
-                //    threadImg.Start();
-                //}
                 Boolean result = iSEM.CmdAutoFocusCoarse();
                 if(result)
                 {
@@ -822,10 +821,11 @@ namespace HOZProject
                     float f_WD = iSEM.GetWorkingDistance();
                     //获取自动对焦后图像以及电镜参数
                     bool imageResult = iSEM.GrabImage(m_ImgAutoFileSavePath, 0, 0, m_ImgWidth, m_ImgHeight, 0);
-                    Bitmap bitmap = new Bitmap(m_ImgAutoFileSavePath);
-                    fShowImage.pbImage.Image = (Image)bitmap;
+                    FileStream fileStream = new FileStream(m_ImgFileSavePath, FileMode.Open, FileAccess.Read);
                     //自动后设置图像与参数
-                    fShowImage.pbAutoImage.Image = Properties.Resources.UCMain;
+                    fShowImage.pbAutoImage.Image = Image.FromStream(fileStream);
+                    fileStream.Close();
+                    fileStream.Dispose();
                     fShowImage.AutoMag = "放大倍数:" + f_Mag;
                     fShowImage.AutoContent = "焦距:" + f_WD;
                     fShowImage.SetAutoParaInfo();
@@ -857,8 +857,10 @@ namespace HOZProject
             bool imageResult = iSEM.GrabImage(m_ImgFileSavePath, 0, 0, m_ImgWidth, m_ImgHeight, 0);
             if (imageResult)
             {
-                Bitmap bitmap = new Bitmap(m_ImgFileSavePath);
-                fShowImage.pbImage.Image = (Image)bitmap;
+                FileStream fileStream = new FileStream(m_ImgFileSavePath, FileMode.Open, FileAccess.Read);
+                fShowImage.pbImage.Image = Image.FromStream(fileStream);
+                fileStream.Close();
+                fileStream.Dispose();
                 fShowImage.Mag = "放大倍数:" + f_Mag;
                 fShowImage.Content = "亮度:"+f_Brightness+"对比度:"+ f_Contrast;
                 fShowImage.SetParaInfo();
@@ -890,8 +892,10 @@ namespace HOZProject
                     float f_Contrast = iSEM.GetContrast();
                     //获取自动对焦后图像以及电镜参数
                     bool imageResult = iSEM.GrabImage(m_ImgAutoFileSavePath, 0, 0, m_ImgWidth, m_ImgHeight, 0);
-                    Bitmap bitmap = new Bitmap(m_ImgFileSavePath);
-                    fShowImage.pbAutoImage.Image = (Image)bitmap;
+                    FileStream fileStream = new FileStream(m_ImgFileSavePath, FileMode.Open, FileAccess.Read);
+                    fShowImage.pbAutoImage.Image = Image.FromStream(fileStream);
+                    fileStream.Close();
+                    fileStream.Dispose();
                     fShowImage.AutoMag = "放大倍数:" + f_Mag;
                     fShowImage.AutoContent = "亮度:" + f_Brightness + "对比度:" + f_Contrast;
                     fShowImage.SetAutoParaInfo();
@@ -923,12 +927,14 @@ namespace HOZProject
             bool imageResult = iSEM.GrabImage(m_ImgFileSavePath, 0, 0, m_ImgWidth, m_ImgHeight, 0);
             if (imageResult)
             {
-                Bitmap bitmap = new Bitmap(m_ImgFileSavePath);
-                fShowImage.pbImage.Image = (Image)bitmap;
+                FileStream fileStream = new FileStream(m_ImgFileSavePath, FileMode.Open, FileAccess.Read);
+                fShowImage.pbImage.Image = Image.FromStream(fileStream);
                 fShowImage.Mag = "放大倍数:" + f_Mag;
                 fShowImage.Content = "消像散X:" + f_AstigmatismX + "消像散Y:" + f_AstigmatismY;
                 fShowImage.SetParaInfo();
                 fShowImage.Show();
+                fileStream.Close();
+                fileStream.Dispose();
                 float result = iSEM.GetAutoVideo();
                 if (result == 0)
                 {
@@ -956,12 +962,14 @@ namespace HOZProject
                     float f_AstigmatismY = iSEM.GetAstigmatismY();
                     //获取自动对焦后图像以及电镜参数
                     bool imageResult = iSEM.GrabImage(m_ImgAutoFileSavePath, 0, 0, m_ImgWidth, m_ImgHeight, 0);
-                    Bitmap bitmap = new Bitmap(m_ImgFileSavePath);
-                    fShowImage.pbAutoImage.Image = (Image)bitmap;
+                    FileStream fileStream = new FileStream(m_ImgFileSavePath, FileMode.Open, FileAccess.Read);
+                    fShowImage.pbAutoImage.Image = Image.FromStream(fileStream);
                     fShowImage.AutoMag = "放大倍数:" + f_Mag;
                     fShowImage.AutoContent = "消像散X:" + f_AstigmatismX + "消像散Y:" + f_AstigmatismY;
                     fShowImage.SetAutoParaInfo();
                     fShowImage.Invalidate();
+                    fileStream.Close();
+                    fileStream.Dispose();
                 }
             }
         }

+ 8 - 8
HOZProject/UnitControl.csproj

@@ -34,14 +34,6 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="FileManager, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\bin\Debug\FileManager.dll</HintPath>
-    </Reference>
-    <Reference Include="MeasureData, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\bin\Debug\MeasureData.dll</HintPath>
-    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Xml.Linq" />
@@ -108,6 +100,14 @@
     <None Include="App.config" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\FileManager\FileManager.csproj">
+      <Project>{14c99f54-b3c2-47cf-adb3-e79fdd2d382f}</Project>
+      <Name>FileManager</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MeasureData\MeasureData.csproj">
+      <Project>{12617585-8d9a-4ad4-b6c4-6894a48cee9e}</Project>
+      <Name>MeasureData</Name>
+    </ProjectReference>
     <ProjectReference Include="..\SmartSEMControl\SmartSEMControl.csproj">
       <Project>{bf7f80b0-a6da-4470-a331-4c96057fc7fa}</Project>
       <Name>SmartSEMControl</Name>