界面修改

This commit is contained in:
zqm
2026-03-24 14:01:13 +08:00
parent 484c357586
commit d1eae0f0ae
6 changed files with 458 additions and 134 deletions

View File

@@ -28,17 +28,29 @@ namespace Test
/// </summary>
private void InitializeComponent()
{
if (this.components == null)
{
this.components = new System.ComponentModel.Container();
}
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.flowLayoutPanel1)).BeginInit();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Controls.Add(this.button1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.button2, 1, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 443);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(804, 33);
this.tableLayoutPanel1.TabIndex = 1;
//
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -49,20 +61,12 @@ namespace Test
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 443);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(804, 33);
this.flowLayoutPanel1.TabIndex = 1;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.LeftToRight;
//
// button1
//
this.button1 = new System.Windows.Forms.Button();
this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
this.button1.Location = new System.Drawing.Point(3, 3);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(400, 33);
this.button1.Size = new System.Drawing.Size(394, 27);
this.button1.TabIndex = 0;
this.button1.Text = "获取摄像头图像";
this.button1.UseVisualStyleBackColor = true;
@@ -70,9 +74,10 @@ namespace Test
//
// button2
//
this.button2 = new System.Windows.Forms.Button();
this.button2.Dock = System.Windows.Forms.DockStyle.Fill;
this.button2.Location = new System.Drawing.Point(403, 3);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(400, 33);
this.button2.Size = new System.Drawing.Size(394, 27);
this.button2.TabIndex = 1;
this.button2.Text = "设置";
this.button2.UseVisualStyleBackColor = true;
@@ -84,18 +89,19 @@ namespace Test
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(804, 476);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "Form1";
this.Text = "摄像头图像获取";
this.Load += new System.EventHandler(Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.flowLayoutPanel1)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
}

View File

@@ -17,7 +17,10 @@ namespace Test
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
_camera = new Camera.Camera();
_camera.ImageCaptured += Camera_ImageCaptured;
}
@@ -59,8 +62,7 @@ namespace Test
private void button2_Click(object sender, EventArgs e)
{
Camera.Setting settingForm = new Camera.Setting();
settingForm.ShowDialog();
_camera.SetArea();
}
protected override void OnFormClosing(FormClosingEventArgs e)