FrmScreenAutomation: Variable FPS selector.

This commit is contained in:
2019-11-02 22:33:31 +01:00
parent 71ab81e11a
commit d7116687f5
2 changed files with 46 additions and 17 deletions

View File

@@ -33,6 +33,7 @@
this.splitOutput = new System.Windows.Forms.SplitContainer(); this.splitOutput = new System.Windows.Forms.SplitContainer();
this.ddlAutomationBot = new System.Windows.Forms.ComboBox(); this.ddlAutomationBot = new System.Windows.Forms.ComboBox();
this.btnStartEnd = new System.Windows.Forms.Button(); this.btnStartEnd = new System.Windows.Forms.Button();
this.numFPS = new System.Windows.Forms.NumericUpDown();
this.picPreview = new VAR.ScreenAutomation.Controls.CtrImageViewer(); this.picPreview = new VAR.ScreenAutomation.Controls.CtrImageViewer();
this.ctrOutput = new VAR.ScreenAutomation.Controls.CtrOutput(); this.ctrOutput = new VAR.ScreenAutomation.Controls.CtrOutput();
((System.ComponentModel.ISupportInitialize)(this.picCapturer)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picCapturer)).BeginInit();
@@ -44,6 +45,7 @@
this.splitOutput.Panel1.SuspendLayout(); this.splitOutput.Panel1.SuspendLayout();
this.splitOutput.Panel2.SuspendLayout(); this.splitOutput.Panel2.SuspendLayout();
this.splitOutput.SuspendLayout(); this.splitOutput.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numFPS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picPreview)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picPreview)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@@ -56,7 +58,7 @@
this.picCapturer.Margin = new System.Windows.Forms.Padding(4); this.picCapturer.Margin = new System.Windows.Forms.Padding(4);
this.picCapturer.Name = "picCapturer"; this.picCapturer.Name = "picCapturer";
this.picCapturer.Padding = new System.Windows.Forms.Padding(10); this.picCapturer.Padding = new System.Windows.Forms.Padding(10);
this.picCapturer.Size = new System.Drawing.Size(424, 799); this.picCapturer.Size = new System.Drawing.Size(501, 799);
this.picCapturer.TabIndex = 0; this.picCapturer.TabIndex = 0;
this.picCapturer.TabStop = false; this.picCapturer.TabStop = false;
// //
@@ -76,7 +78,7 @@
// //
this.splitMain.Panel2.Controls.Add(this.picCapturer); this.splitMain.Panel2.Controls.Add(this.picCapturer);
this.splitMain.Size = new System.Drawing.Size(754, 816); this.splitMain.Size = new System.Drawing.Size(754, 816);
this.splitMain.SplitterDistance = 309; this.splitMain.SplitterDistance = 232;
this.splitMain.TabIndex = 3; this.splitMain.TabIndex = 3;
// //
// splitOutput // splitOutput
@@ -92,11 +94,12 @@
// //
// splitOutput.Panel2 // splitOutput.Panel2
// //
this.splitOutput.Panel2.Controls.Add(this.numFPS);
this.splitOutput.Panel2.Controls.Add(this.ddlAutomationBot); this.splitOutput.Panel2.Controls.Add(this.ddlAutomationBot);
this.splitOutput.Panel2.Controls.Add(this.btnStartEnd); this.splitOutput.Panel2.Controls.Add(this.btnStartEnd);
this.splitOutput.Panel2.Controls.Add(this.ctrOutput); this.splitOutput.Panel2.Controls.Add(this.ctrOutput);
this.splitOutput.Size = new System.Drawing.Size(309, 816); this.splitOutput.Size = new System.Drawing.Size(232, 816);
this.splitOutput.SplitterDistance = 371; this.splitOutput.SplitterDistance = 283;
this.splitOutput.TabIndex = 4; this.splitOutput.TabIndex = 4;
// //
// ddlAutomationBot // ddlAutomationBot
@@ -107,7 +110,7 @@
this.ddlAutomationBot.FormattingEnabled = true; this.ddlAutomationBot.FormattingEnabled = true;
this.ddlAutomationBot.Location = new System.Drawing.Point(13, 4); this.ddlAutomationBot.Location = new System.Drawing.Point(13, 4);
this.ddlAutomationBot.Name = "ddlAutomationBot"; this.ddlAutomationBot.Name = "ddlAutomationBot";
this.ddlAutomationBot.Size = new System.Drawing.Size(293, 24); this.ddlAutomationBot.Size = new System.Drawing.Size(216, 24);
this.ddlAutomationBot.TabIndex = 4; this.ddlAutomationBot.TabIndex = 4;
this.ddlAutomationBot.SelectedIndexChanged += new System.EventHandler(this.DdlAutomationBot_SelectedIndexChanged); this.ddlAutomationBot.SelectedIndexChanged += new System.EventHandler(this.DdlAutomationBot_SelectedIndexChanged);
// //
@@ -118,12 +121,35 @@
this.btnStartEnd.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnStartEnd.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnStartEnd.Location = new System.Drawing.Point(15, 34); this.btnStartEnd.Location = new System.Drawing.Point(15, 34);
this.btnStartEnd.Name = "btnStartEnd"; this.btnStartEnd.Name = "btnStartEnd";
this.btnStartEnd.Size = new System.Drawing.Size(294, 39); this.btnStartEnd.Size = new System.Drawing.Size(149, 39);
this.btnStartEnd.TabIndex = 3; this.btnStartEnd.TabIndex = 3;
this.btnStartEnd.Text = "Start"; this.btnStartEnd.Text = "Start";
this.btnStartEnd.UseVisualStyleBackColor = true; this.btnStartEnd.UseVisualStyleBackColor = true;
this.btnStartEnd.Click += new System.EventHandler(this.BtnStartEnd_Click); this.btnStartEnd.Click += new System.EventHandler(this.BtnStartEnd_Click);
// //
// numFPS
//
this.numFPS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.numFPS.Location = new System.Drawing.Point(170, 50);
this.numFPS.Maximum = new decimal(new int[] {
60,
0,
0,
0});
this.numFPS.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numFPS.Name = "numFPS";
this.numFPS.Size = new System.Drawing.Size(59, 22);
this.numFPS.TabIndex = 5;
this.numFPS.Value = new decimal(new int[] {
20,
0,
0,
0});
//
// picPreview // picPreview
// //
this.picPreview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.picPreview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@@ -133,7 +159,7 @@
this.picPreview.ImageShow = null; this.picPreview.ImageShow = null;
this.picPreview.Location = new System.Drawing.Point(12, 12); this.picPreview.Location = new System.Drawing.Point(12, 12);
this.picPreview.Name = "picPreview"; this.picPreview.Name = "picPreview";
this.picPreview.Size = new System.Drawing.Size(294, 356); this.picPreview.Size = new System.Drawing.Size(217, 268);
this.picPreview.TabIndex = 1; this.picPreview.TabIndex = 1;
this.picPreview.TabStop = false; this.picPreview.TabStop = false;
// //
@@ -144,7 +170,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.ctrOutput.Location = new System.Drawing.Point(12, 79); this.ctrOutput.Location = new System.Drawing.Point(12, 79);
this.ctrOutput.Name = "ctrOutput"; this.ctrOutput.Name = "ctrOutput";
this.ctrOutput.Size = new System.Drawing.Size(294, 349); this.ctrOutput.Size = new System.Drawing.Size(217, 437);
this.ctrOutput.TabIndex = 2; this.ctrOutput.TabIndex = 2;
this.ctrOutput.Text = "ctrOutput1"; this.ctrOutput.Text = "ctrOutput1";
// //
@@ -167,6 +193,7 @@
this.splitOutput.Panel2.ResumeLayout(false); this.splitOutput.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitOutput)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitOutput)).EndInit();
this.splitOutput.ResumeLayout(false); this.splitOutput.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.numFPS)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picPreview)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.picPreview)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
@@ -181,6 +208,7 @@
private System.Windows.Forms.SplitContainer splitOutput; private System.Windows.Forms.SplitContainer splitOutput;
private System.Windows.Forms.Button btnStartEnd; private System.Windows.Forms.Button btnStartEnd;
private System.Windows.Forms.ComboBox ddlAutomationBot; private System.Windows.Forms.ComboBox ddlAutomationBot;
private System.Windows.Forms.NumericUpDown numFPS;
} }
} }

View File

@@ -40,7 +40,7 @@ namespace VAR.ScreenAutomation
if (components == null) { components = new Container(); } if (components == null) { components = new Container(); }
timTicker = new Timer(components) timTicker = new Timer(components)
{ {
Interval = 100, Interval = Convert.ToInt32(1000 / numFPS.Value),
}; };
timTicker.Tick += TimTicker_Tick; timTicker.Tick += TimTicker_Tick;
timTicker.Enabled = true; timTicker.Enabled = true;
@@ -70,6 +70,7 @@ namespace VAR.ScreenAutomation
} }
picPreview.ImageShow = bmpScreen; picPreview.ImageShow = bmpScreen;
timTicker.Interval = Convert.ToInt32(1000 / numFPS.Value);
timTicker.Enabled = true; timTicker.Enabled = true;
timTicker.Start(); timTicker.Start();
} }