diff --git a/.vs/quick-screen-recorder/v16/.suo b/.vs/quick-screen-recorder/v16/.suo index a06e4c2..db2d5ea 100644 Binary files a/.vs/quick-screen-recorder/v16/.suo and b/.vs/quick-screen-recorder/v16/.suo differ diff --git a/.vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide b/.vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide index 8a763b8..228039e 100644 Binary files a/.vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide and b/.vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide differ diff --git a/.vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide-shm b/.vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide-shm deleted file mode 100644 index 3cdb2d4..0000000 Binary files a/.vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide-shm and /dev/null differ diff --git a/.vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide-wal b/.vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide-wal deleted file mode 100644 index d79c9df..0000000 Binary files a/.vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide-wal and /dev/null differ diff --git a/quick-screen-recorder/App.config b/quick-screen-recorder/App.config index 533729f..9f8d47f 100644 --- a/quick-screen-recorder/App.config +++ b/quick-screen-recorder/App.config @@ -16,6 +16,15 @@ True + + 2 + + + True + + + False + \ No newline at end of file diff --git a/quick-screen-recorder/AreaForm.Designer.cs b/quick-screen-recorder/AreaForm.Designer.cs index 95ce295..7a84726 100644 --- a/quick-screen-recorder/AreaForm.Designer.cs +++ b/quick-screen-recorder/AreaForm.Designer.cs @@ -29,7 +29,7 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.dragBtn = new System.Windows.Forms.Button(); - this.sizeBtn = new System.Windows.Forms.Button(); + this.titleBtn = new System.Windows.Forms.Button(); this.SuspendLayout(); // // dragBtn @@ -41,43 +41,45 @@ private void InitializeComponent() this.dragBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.dragBtn.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.dragBtn.ForeColor = System.Drawing.SystemColors.ControlText; - this.dragBtn.Location = new System.Drawing.Point(414, 254); + this.dragBtn.Location = new System.Drawing.Point(412, 252); this.dragBtn.Name = "dragBtn"; this.dragBtn.Size = new System.Drawing.Size(56, 56); this.dragBtn.TabIndex = 0; this.dragBtn.Text = "Drag here to resize"; this.dragBtn.UseVisualStyleBackColor = false; // - // sizeBtn + // titleBtn // - this.sizeBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); - this.sizeBtn.Enabled = false; - this.sizeBtn.FlatAppearance.BorderColor = System.Drawing.Color.Red; - this.sizeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.sizeBtn.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.sizeBtn.ForeColor = System.Drawing.SystemColors.ControlText; - this.sizeBtn.Location = new System.Drawing.Point(12, 12); - this.sizeBtn.Name = "sizeBtn"; - this.sizeBtn.Size = new System.Drawing.Size(56, 56); - this.sizeBtn.TabIndex = 1; - this.sizeBtn.UseVisualStyleBackColor = false; + this.titleBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128))))); + this.titleBtn.Enabled = false; + this.titleBtn.FlatAppearance.BorderColor = System.Drawing.Color.Red; + this.titleBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.titleBtn.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.titleBtn.ForeColor = System.Drawing.SystemColors.ControlText; + this.titleBtn.Location = new System.Drawing.Point(12, 12); + this.titleBtn.Name = "titleBtn"; + this.titleBtn.Size = new System.Drawing.Size(90, 25); + this.titleBtn.TabIndex = 1; + this.titleBtn.Text = "Screen area"; + this.titleBtn.UseVisualStyleBackColor = false; // // AreaForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.MediumBlue; - this.ClientSize = new System.Drawing.Size(482, 322); - this.Controls.Add(this.sizeBtn); + this.ClientSize = new System.Drawing.Size(480, 320); + this.Controls.Add(this.titleBtn); this.Controls.Add(this.dragBtn); this.ForeColor = System.Drawing.SystemColors.ControlText; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MinimumSize = new System.Drawing.Size(162, 162); + this.MinimumSize = new System.Drawing.Size(160, 160); this.Name = "AreaForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Recording area - Quick Screen Recorder"; this.TopMost = true; this.TransparencyKey = System.Drawing.Color.MediumBlue; + this.ResizeEnd += new System.EventHandler(this.AreaForm_ResizeEnd); this.LocationChanged += new System.EventHandler(this.AreaForm_LocationChanged); this.SizeChanged += new System.EventHandler(this.AreaForm_SizeChanged); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AreaForm_MouseDown); @@ -89,6 +91,6 @@ private void InitializeComponent() #endregion private System.Windows.Forms.Button dragBtn; - private System.Windows.Forms.Button sizeBtn; + private System.Windows.Forms.Button titleBtn; } } \ No newline at end of file diff --git a/quick-screen-recorder/AreaForm.cs b/quick-screen-recorder/AreaForm.cs index b48a5dc..fad8586 100644 --- a/quick-screen-recorder/AreaForm.cs +++ b/quick-screen-recorder/AreaForm.cs @@ -18,7 +18,10 @@ public partial class AreaForm : Form private Point startPos; private Size curSize; - System.Timers.Timer resizeTimer = new System.Timers.Timer(); + private System.Timers.Timer resizeTimer = new System.Timers.Timer(); + + private int maxWidth = 4096; + private int maxHeight = 4096; public AreaForm() { @@ -36,8 +39,11 @@ private void resizeTimer_Elapsed(object sender, ElapsedEventArgs e) int newWidth = curSize.Width + curPos.X - startPos.X; int newHeight = curSize.Height + curPos.Y - startPos.Y; - (this.Owner as MainForm).SetAreaWidth(newWidth - 2); - (this.Owner as MainForm).SetAreaHeight(newHeight - 2); + if (newWidth > 4096) newWidth = 4096; + if (newHeight > 4096) newHeight = 4096; + + (this.Owner as MainForm).SetAreaWidth(newWidth); + (this.Owner as MainForm).SetAreaHeight(newHeight); })); } @@ -77,11 +83,29 @@ private void AreaForm_MouseUp(object sender, MouseEventArgs e) private void AreaForm_SizeChanged(object sender, EventArgs e) { this.Refresh(); + (this.Owner as MainForm).SetMaximumX(maxWidth - this.Width); + (this.Owner as MainForm).SetMaximumY(maxHeight - this.Height); } private void AreaForm_LocationChanged(object sender, EventArgs e) { - sizeBtn.Text = "X:" + (this.Location.X + 1) + "\nY:" + (this.Location.Y + 1); + (this.Owner as MainForm).SetAreaX(this.Left); + (this.Owner as MainForm).SetAreaY(this.Top); + } + + public void SetMaximumArea(int maxW, int maxH) + { + maxWidth = maxW; + maxHeight = maxH; + } + + private void AreaForm_ResizeEnd(object sender, EventArgs e) + { + if (this.Left < 0) this.Left = 0; + if (this.Top < 0) this.Top = 0; + + if (this.Left + this.Width > maxWidth) this.Left = maxWidth - this.Width; + if (this.Top + this.Height > maxHeight) this.Top = maxHeight - this.Height; } } } diff --git a/quick-screen-recorder/CustomComboBox.cs b/quick-screen-recorder/CustomComboBox.cs index 4da3cc8..6127975 100644 --- a/quick-screen-recorder/CustomComboBox.cs +++ b/quick-screen-recorder/CustomComboBox.cs @@ -57,7 +57,10 @@ protected override void OnPaint(PaintEventArgs e) protected override void OnDrawItem(DrawItemEventArgs e) { e.DrawBackground(); - e.Graphics.DrawString(this.Items[e.Index].ToString(), this.Font, new SolidBrush(this.ForeColor), e.Bounds.X, e.Bounds.Y); + if (e.Index != -1) + { + e.Graphics.DrawString(this.Items[e.Index].ToString(), this.Font, new SolidBrush(this.ForeColor), e.Bounds.X, e.Bounds.Y); + } } } } diff --git a/quick-screen-recorder/MainForm.Designer.cs b/quick-screen-recorder/MainForm.Designer.cs index d9ca4d1..772b9c4 100644 --- a/quick-screen-recorder/MainForm.Designer.cs +++ b/quick-screen-recorder/MainForm.Designer.cs @@ -39,6 +39,12 @@ private void InitializeComponent() this.qualityLabel = new System.Windows.Forms.Label(); this.areaLabel = new System.Windows.Forms.Label(); this.videoGroup = new System.Windows.Forms.GroupBox(); + this.refreshScreensBtn = new System.Windows.Forms.Button(); + this.hideTaskbarCheckBox = new quick_screen_recorder.CustomCheckBox(); + this.sizelabel = new System.Windows.Forms.Label(); + this.yNumeric = new quick_screen_recorder.CustomNumericBox(); + this.xNumeric = new quick_screen_recorder.CustomNumericBox(); + this.locationLabel = new System.Windows.Forms.Label(); this.widthNumeric = new quick_screen_recorder.CustomNumericBox(); this.qualityComboBox = new quick_screen_recorder.CustomComboBox(); this.heightNumeric = new quick_screen_recorder.CustomNumericBox(); @@ -46,7 +52,7 @@ private void InitializeComponent() this.captureCursorCheckBox = new quick_screen_recorder.CustomCheckBox(); this.inputDeviceLabel = new System.Windows.Forms.Label(); this.audioGroup = new System.Windows.Forms.GroupBox(); - this.refreshBtn = new System.Windows.Forms.Button(); + this.refreshAudioBtn = new System.Windows.Forms.Button(); this.inputDeviceComboBox = new quick_screen_recorder.CustomComboBox(); this.separateAudioCheckBox = new quick_screen_recorder.CustomCheckBox(); this.generalGroup = new System.Windows.Forms.GroupBox(); @@ -58,6 +64,8 @@ private void InitializeComponent() this.settingsBtn = new System.Windows.Forms.ToolStripButton(); this.aboutBtn = new System.Windows.Forms.ToolStripButton(); this.videoGroup.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.yNumeric)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.xNumeric)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.widthNumeric)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.heightNumeric)).BeginInit(); this.audioGroup.SuspendLayout(); @@ -71,7 +79,7 @@ private void InitializeComponent() this.folderTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.folderTextBox.Location = new System.Drawing.Point(73, 22); this.folderTextBox.Name = "folderTextBox"; - this.folderTextBox.Size = new System.Drawing.Size(171, 23); + this.folderTextBox.Size = new System.Drawing.Size(191, 23); this.folderTextBox.TabIndex = 3; // // browseFolderBtn @@ -79,7 +87,7 @@ private void InitializeComponent() this.browseFolderBtn.BackColor = System.Drawing.SystemColors.ControlLight; this.browseFolderBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100))))); this.browseFolderBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.browseFolderBtn.Location = new System.Drawing.Point(251, 22); + this.browseFolderBtn.Location = new System.Drawing.Point(271, 22); this.browseFolderBtn.Name = "browseFolderBtn"; this.browseFolderBtn.Size = new System.Drawing.Size(69, 23); this.browseFolderBtn.TabIndex = 4; @@ -102,7 +110,7 @@ private void InitializeComponent() this.fileNameTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.fileNameTextBox.Location = new System.Drawing.Point(73, 52); this.fileNameTextBox.Name = "fileNameTextBox"; - this.fileNameTextBox.Size = new System.Drawing.Size(216, 23); + this.fileNameTextBox.Size = new System.Drawing.Size(236, 23); this.fileNameTextBox.TabIndex = 5; this.fileNameTextBox.Text = "NewVideo1"; // @@ -135,6 +143,12 @@ private void InitializeComponent() // // videoGroup // + this.videoGroup.Controls.Add(this.refreshScreensBtn); + this.videoGroup.Controls.Add(this.hideTaskbarCheckBox); + this.videoGroup.Controls.Add(this.sizelabel); + this.videoGroup.Controls.Add(this.yNumeric); + this.videoGroup.Controls.Add(this.xNumeric); + this.videoGroup.Controls.Add(this.locationLabel); this.videoGroup.Controls.Add(this.widthNumeric); this.videoGroup.Controls.Add(this.qualityComboBox); this.videoGroup.Controls.Add(this.heightNumeric); @@ -145,15 +159,85 @@ private void InitializeComponent() this.videoGroup.Location = new System.Drawing.Point(9, 157); this.videoGroup.Margin = new System.Windows.Forms.Padding(0, 9, 0, 0); this.videoGroup.Name = "videoGroup"; - this.videoGroup.Size = new System.Drawing.Size(326, 106); + this.videoGroup.Size = new System.Drawing.Size(346, 140); this.videoGroup.TabIndex = 6; this.videoGroup.TabStop = false; this.videoGroup.Text = "Video options"; // + // refreshScreensBtn + // + this.refreshScreensBtn.BackColor = System.Drawing.SystemColors.ControlLight; + this.refreshScreensBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100))))); + this.refreshScreensBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.refreshScreensBtn.Image = ((System.Drawing.Image)(resources.GetObject("refreshScreensBtn.Image"))); + this.refreshScreensBtn.Location = new System.Drawing.Point(317, 52); + this.refreshScreensBtn.Margin = new System.Windows.Forms.Padding(0); + this.refreshScreensBtn.Name = "refreshScreensBtn"; + this.refreshScreensBtn.Size = new System.Drawing.Size(23, 23); + this.refreshScreensBtn.TabIndex = 27; + this.refreshScreensBtn.UseVisualStyleBackColor = false; + this.refreshScreensBtn.Click += new System.EventHandler(this.refreshScreensBtn_Click); + // + // hideTaskbarCheckBox + // + this.hideTaskbarCheckBox.Location = new System.Drawing.Point(138, 113); + this.hideTaskbarCheckBox.Name = "hideTaskbarCheckBox"; + this.hideTaskbarCheckBox.Size = new System.Drawing.Size(92, 19); + this.hideTaskbarCheckBox.TabIndex = 23; + this.hideTaskbarCheckBox.Text = "Hide taskbar"; + this.hideTaskbarCheckBox.UseVisualStyleBackColor = true; + this.hideTaskbarCheckBox.CheckedChanged += new System.EventHandler(this.hideTaskbarCheckBox_CheckedChanged); + // + // sizelabel + // + this.sizelabel.AutoSize = true; + this.sizelabel.Location = new System.Drawing.Point(198, 84); + this.sizelabel.Name = "sizelabel"; + this.sizelabel.Size = new System.Drawing.Size(30, 15); + this.sizelabel.TabIndex = 22; + this.sizelabel.Text = "Size:"; + // + // yNumeric + // + this.yNumeric.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.yNumeric.Location = new System.Drawing.Point(129, 82); + this.yNumeric.Maximum = new decimal(new int[] { + 4095, + 0, + 0, + 0}); + this.yNumeric.Name = "yNumeric"; + this.yNumeric.Size = new System.Drawing.Size(50, 23); + this.yNumeric.TabIndex = 21; + this.yNumeric.ValueChanged += new System.EventHandler(this.yNumeric_ValueChanged); + // + // xNumeric + // + this.xNumeric.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.xNumeric.Location = new System.Drawing.Point(73, 82); + this.xNumeric.Maximum = new decimal(new int[] { + 4095, + 0, + 0, + 0}); + this.xNumeric.Name = "xNumeric"; + this.xNumeric.Size = new System.Drawing.Size(50, 23); + this.xNumeric.TabIndex = 20; + this.xNumeric.ValueChanged += new System.EventHandler(this.xNumeric_ValueChanged); + // + // locationLabel + // + this.locationLabel.AutoSize = true; + this.locationLabel.Location = new System.Drawing.Point(11, 84); + this.locationLabel.Name = "locationLabel"; + this.locationLabel.Size = new System.Drawing.Size(56, 15); + this.locationLabel.TabIndex = 19; + this.locationLabel.Text = "Location:"; + // // widthNumeric // this.widthNumeric.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.widthNumeric.Location = new System.Drawing.Point(193, 52); + this.widthNumeric.Location = new System.Drawing.Point(234, 82); this.widthNumeric.Maximum = new decimal(new int[] { 4096, 0, @@ -165,7 +249,7 @@ private void InitializeComponent() 0, 0}); this.widthNumeric.Name = "widthNumeric"; - this.widthNumeric.Size = new System.Drawing.Size(60, 23); + this.widthNumeric.Size = new System.Drawing.Size(50, 23); this.widthNumeric.TabIndex = 9; this.widthNumeric.Value = new decimal(new int[] { 160, @@ -183,19 +267,21 @@ private void InitializeComponent() this.qualityComboBox.FormattingEnabled = true; this.qualityComboBox.IntegralHeight = false; this.qualityComboBox.Items.AddRange(new object[] { - "25% - Low", - "50% - Medium", - "75% - High", - "100% - Original"}); + "25% - Low (Motion JPEG)", + "50% - Medium (Motion JPEG)", + "75% - High (Motion JPEG)", + "100% - Original (Motion JPEG)", + "Uncompressed"}); this.qualityComboBox.Location = new System.Drawing.Point(73, 22); this.qualityComboBox.Name = "qualityComboBox"; - this.qualityComboBox.Size = new System.Drawing.Size(247, 24); + this.qualityComboBox.Size = new System.Drawing.Size(267, 24); this.qualityComboBox.TabIndex = 7; + this.qualityComboBox.SelectedIndexChanged += new System.EventHandler(this.qualityComboBox_SelectedIndexChanged); // // heightNumeric // this.heightNumeric.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.heightNumeric.Location = new System.Drawing.Point(260, 52); + this.heightNumeric.Location = new System.Drawing.Point(290, 82); this.heightNumeric.Maximum = new decimal(new int[] { 4096, 0, @@ -207,7 +293,7 @@ private void InitializeComponent() 0, 0}); this.heightNumeric.Name = "heightNumeric"; - this.heightNumeric.Size = new System.Drawing.Size(60, 23); + this.heightNumeric.Size = new System.Drawing.Size(50, 23); this.heightNumeric.TabIndex = 10; this.heightNumeric.Value = new decimal(new int[] { 160, @@ -222,12 +308,9 @@ private void InitializeComponent() this.areaComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.areaComboBox.FormattingEnabled = true; this.areaComboBox.IntegralHeight = false; - this.areaComboBox.Items.AddRange(new object[] { - "Fullscreen", - "Custom area"}); this.areaComboBox.Location = new System.Drawing.Point(73, 52); this.areaComboBox.Name = "areaComboBox"; - this.areaComboBox.Size = new System.Drawing.Size(113, 24); + this.areaComboBox.Size = new System.Drawing.Size(237, 24); this.areaComboBox.TabIndex = 8; this.areaComboBox.SelectedIndexChanged += new System.EventHandler(this.areaComboBox_SelectedIndexChanged); // @@ -235,12 +318,13 @@ private void InitializeComponent() // this.captureCursorCheckBox.Checked = true; this.captureCursorCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.captureCursorCheckBox.Location = new System.Drawing.Point(216, 81); + this.captureCursorCheckBox.Location = new System.Drawing.Point(236, 113); this.captureCursorCheckBox.Name = "captureCursorCheckBox"; this.captureCursorCheckBox.Size = new System.Drawing.Size(104, 19); this.captureCursorCheckBox.TabIndex = 11; this.captureCursorCheckBox.Text = "Capture cursor"; this.captureCursorCheckBox.UseVisualStyleBackColor = true; + this.captureCursorCheckBox.CheckedChanged += new System.EventHandler(this.captureCursorCheckBox_CheckedChanged); // // inputDeviceLabel // @@ -253,31 +337,31 @@ private void InitializeComponent() // // audioGroup // - this.audioGroup.Controls.Add(this.refreshBtn); + this.audioGroup.Controls.Add(this.refreshAudioBtn); this.audioGroup.Controls.Add(this.inputDeviceComboBox); this.audioGroup.Controls.Add(this.separateAudioCheckBox); this.audioGroup.Controls.Add(this.inputDeviceLabel); - this.audioGroup.Location = new System.Drawing.Point(9, 272); + this.audioGroup.Location = new System.Drawing.Point(9, 306); this.audioGroup.Margin = new System.Windows.Forms.Padding(0, 9, 0, 0); this.audioGroup.Name = "audioGroup"; - this.audioGroup.Size = new System.Drawing.Size(326, 76); + this.audioGroup.Size = new System.Drawing.Size(346, 80); this.audioGroup.TabIndex = 24; this.audioGroup.TabStop = false; this.audioGroup.Text = "Audio options"; // - // refreshBtn + // refreshAudioBtn // - this.refreshBtn.BackColor = System.Drawing.SystemColors.ControlLight; - this.refreshBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100))))); - this.refreshBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.refreshBtn.Image = ((System.Drawing.Image)(resources.GetObject("refreshBtn.Image"))); - this.refreshBtn.Location = new System.Drawing.Point(297, 22); - this.refreshBtn.Margin = new System.Windows.Forms.Padding(0); - this.refreshBtn.Name = "refreshBtn"; - this.refreshBtn.Size = new System.Drawing.Size(23, 23); - this.refreshBtn.TabIndex = 13; - this.refreshBtn.UseVisualStyleBackColor = false; - this.refreshBtn.Click += new System.EventHandler(this.refreshBtn_Click); + this.refreshAudioBtn.BackColor = System.Drawing.SystemColors.ControlLight; + this.refreshAudioBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(100)))), ((int)(((byte)(100))))); + this.refreshAudioBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.refreshAudioBtn.Image = ((System.Drawing.Image)(resources.GetObject("refreshAudioBtn.Image"))); + this.refreshAudioBtn.Location = new System.Drawing.Point(317, 22); + this.refreshAudioBtn.Margin = new System.Windows.Forms.Padding(0); + this.refreshAudioBtn.Name = "refreshAudioBtn"; + this.refreshAudioBtn.Size = new System.Drawing.Size(23, 23); + this.refreshAudioBtn.TabIndex = 13; + this.refreshAudioBtn.UseVisualStyleBackColor = false; + this.refreshAudioBtn.Click += new System.EventHandler(this.refreshBtn_Click); // // inputDeviceComboBox // @@ -292,13 +376,13 @@ private void InitializeComponent() "System sounds (Soundcard)"}); this.inputDeviceComboBox.Location = new System.Drawing.Point(73, 22); this.inputDeviceComboBox.Name = "inputDeviceComboBox"; - this.inputDeviceComboBox.Size = new System.Drawing.Size(217, 24); + this.inputDeviceComboBox.Size = new System.Drawing.Size(237, 24); this.inputDeviceComboBox.TabIndex = 12; this.inputDeviceComboBox.SelectedIndexChanged += new System.EventHandler(this.inputDeviceComboBox_SelectedIndexChanged); // // separateAudioCheckBox // - this.separateAudioCheckBox.Location = new System.Drawing.Point(109, 51); + this.separateAudioCheckBox.Location = new System.Drawing.Point(129, 53); this.separateAudioCheckBox.Name = "separateAudioCheckBox"; this.separateAudioCheckBox.Size = new System.Drawing.Size(211, 19); this.separateAudioCheckBox.TabIndex = 14; @@ -316,7 +400,7 @@ private void InitializeComponent() this.generalGroup.Location = new System.Drawing.Point(9, 58); this.generalGroup.Margin = new System.Windows.Forms.Padding(0, 9, 0, 0); this.generalGroup.Name = "generalGroup"; - this.generalGroup.Size = new System.Drawing.Size(326, 90); + this.generalGroup.Size = new System.Drawing.Size(346, 90); this.generalGroup.TabIndex = 2; this.generalGroup.TabStop = false; this.generalGroup.Text = "General options"; @@ -324,7 +408,7 @@ private void InitializeComponent() // aviLabel // this.aviLabel.AutoSize = true; - this.aviLabel.Location = new System.Drawing.Point(295, 55); + this.aviLabel.Location = new System.Drawing.Point(315, 55); this.aviLabel.Name = "aviLabel"; this.aviLabel.Size = new System.Drawing.Size(25, 15); this.aviLabel.TabIndex = 26; @@ -356,11 +440,11 @@ private void InitializeComponent() this.onTopBtn, this.settingsBtn, this.aboutBtn}); - this.toolStrip1.Location = new System.Drawing.Point(260, 0); + this.toolStrip1.Location = new System.Drawing.Point(280, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Padding = new System.Windows.Forms.Padding(5); this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.toolStrip1.Size = new System.Drawing.Size(115, 35); + this.toolStrip1.Size = new System.Drawing.Size(84, 35); this.toolStrip1.TabIndex = 1; this.toolStrip1.TabStop = true; this.toolStrip1.Text = "toolStrip1"; @@ -408,7 +492,7 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(344, 356); + this.ClientSize = new System.Drawing.Size(364, 394); this.Controls.Add(this.toolStrip1); this.Controls.Add(this.generalGroup); this.Controls.Add(this.audioGroup); @@ -417,6 +501,7 @@ private void InitializeComponent() this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.KeyPreview = true; this.MaximizeBox = false; this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; @@ -426,6 +511,8 @@ private void InitializeComponent() this.Load += new System.EventHandler(this.MainForm_Load); this.videoGroup.ResumeLayout(false); this.videoGroup.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.yNumeric)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.xNumeric)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.widthNumeric)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.heightNumeric)).EndInit(); this.audioGroup.ResumeLayout(false); @@ -462,12 +549,18 @@ private void InitializeComponent() private CustomComboBox inputDeviceComboBox; private CustomNumericBox heightNumeric; private CustomNumericBox widthNumeric; - private System.Windows.Forms.Button refreshBtn; + private System.Windows.Forms.Button refreshAudioBtn; private CustomToolStrip toolStrip1; private System.Windows.Forms.ToolStripButton onTopBtn; private System.Windows.Forms.ToolStripButton aboutBtn; private System.Windows.Forms.ToolStripButton settingsBtn; private CustomCheckBox separateAudioCheckBox; + private System.Windows.Forms.Label locationLabel; + private CustomNumericBox xNumeric; + private CustomNumericBox yNumeric; + private System.Windows.Forms.Label sizelabel; + private CustomCheckBox hideTaskbarCheckBox; + private System.Windows.Forms.Button refreshScreensBtn; } } diff --git a/quick-screen-recorder/MainForm.cs b/quick-screen-recorder/MainForm.cs index 9332659..8069dc4 100644 --- a/quick-screen-recorder/MainForm.cs +++ b/quick-screen-recorder/MainForm.cs @@ -2,6 +2,7 @@ using System; using System.Data; using System.Drawing; +using System.IO; using System.Linq; using System.Windows.Forms; @@ -32,10 +33,9 @@ public MainForm(bool darkMode) folderTextBox.Text = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); - qualityComboBox.SelectedIndex = 2; - areaComboBox.SelectedIndex = 0; inputDeviceComboBox.SelectedIndex = 0; + RefreshScreens(); RefreshAudioDevices(); if (darkMode) @@ -75,12 +75,18 @@ private void applyDarkTheme() widthNumeric.SetDarkMode(true); heightNumeric.SetDarkMode(true); + xNumeric.SetDarkMode(true); + yNumeric.SetDarkMode(true); + + refreshAudioBtn.BackColor = ThemeManager.DarkSecondColor; + refreshAudioBtn.Image = Properties.Resources.white_refresh; - refreshBtn.BackColor = ThemeManager.DarkSecondColor; - refreshBtn.Image = Properties.Resources.white_refresh; + refreshScreensBtn.BackColor = ThemeManager.DarkSecondColor; + refreshScreensBtn.Image = Properties.Resources.white_refresh; separateAudioCheckBox.SetDarkMode(true); captureCursorCheckBox.SetDarkMode(true); + hideTaskbarCheckBox.SetDarkMode(true); } public void SetAreaWidth(int w) @@ -121,6 +127,54 @@ public void SetAreaHeight(int h) } } + public void SetAreaX(int x) + { + if (x > xNumeric.Maximum) + { + xNumeric.Value = xNumeric.Maximum; + } + else + { + if (x < xNumeric.Minimum) + { + xNumeric.Value = xNumeric.Minimum; + } + else + { + xNumeric.Value = x; + } + } + } + + public void SetAreaY(int y) + { + if (y > yNumeric.Maximum) + { + yNumeric.Value = yNumeric.Maximum; + } + else + { + if (y < xNumeric.Minimum) + { + yNumeric.Value = yNumeric.Minimum; + } + else + { + yNumeric.Value = y; + } + } + } + + public void SetMaximumX(int maxX) + { + xNumeric.Maximum = maxX; + } + + public void SetMaximumY(int maxY) + { + yNumeric.Maximum = maxY; + } + public async void checkForUpdates(bool showUpToDateDialog) { try @@ -166,7 +220,7 @@ public async void checkForUpdates(bool showUpToDateDialog) private void recButton_Click(object sender, EventArgs e) { - StartRec(); + CheckStartRec(); } public void StopRec() @@ -175,7 +229,7 @@ public void StopRec() { HotkeyManager.RegisterHotKey(this.Handle, 0, (int)HotkeyManager.KeyModifier.Alt, Keys.R.GetHashCode()); - if (areaComboBox.SelectedIndex == 1) + if (areaComboBox.SelectedIndex == areaComboBox.Items.Count - 1) { areaForm.Show(); } @@ -190,36 +244,44 @@ public void StopRec() } } - private void StartRec() + private void CheckStartRec() + { + string path = folderTextBox.Text + "/" + fileNameTextBox.Text + ".avi"; + + if (File.Exists(path)) + { + DialogResult window = MessageBox.Show( + fileNameTextBox.Text + ".avi already exists.\nDo you want to replace it and start recording?", + "Warning", + MessageBoxButtons.YesNo, + MessageBoxIcon.Question + ); + + if (window == DialogResult.Yes) + { + StartRec(path); + } + } + else + { + StartRec(path); + } + } + + private void StartRec(string path) { try { - string folder = folderTextBox.Text; - string fileName = fileNameTextBox.Text; - int quality = Convert.ToInt32(string.Concat(qualityComboBox.Text.Where(char.IsDigit))); + int quality = 0; + int.TryParse(string.Concat(qualityComboBox.Text.Where(char.IsDigit)), out quality); int inputSourceIndex = inputDeviceComboBox.SelectedIndex - 2; - int x = 0; - int y = 0; - int width = 0; - int height = 0; - - if (areaComboBox.SelectedIndex == 1) - { - x = areaForm.Location.X + 1; - y = areaForm.Location.Y + 1; - width = (int)widthNumeric.Value; - height = (int)heightNumeric.Value; - } - else - { - x = 0; - y = 0; - width = Screen.PrimaryScreen.Bounds.Width; - height = Screen.PrimaryScreen.Bounds.Height; - } + int width = (int)widthNumeric.Value; + int height = (int)heightNumeric.Value; + int x = (int)xNumeric.Value; + int y = (int)yNumeric.Value; - recorder = new Recorder(folder + "/" + fileName + ".avi", + recorder = new Recorder(path, quality, x, y, width, height, captureCursorCheckBox.Checked, inputSourceIndex, separateAudioCheckBox.Checked); recorder.OnPeakVolumeChanged += Recorder_OnPeakVolumeChanged; @@ -229,7 +291,15 @@ private void StartRec() HotkeyManager.UnregisterHotKey(this.Handle, 0); - string videoStr = videoStr = width + "x" + height + " (" + quality + "%"; + string videoStr = videoStr = width + "x" + height + " ("; + if (quality == 0) + { + videoStr += "Uncompressed"; + } + else + { + videoStr += quality + "%"; + } if (captureCursorCheckBox.Checked) { videoStr += ", Cursor"; @@ -277,15 +347,26 @@ private void aboutBtn_Click(object sender, EventArgs e) private void areaComboBox_SelectedIndexChanged(object sender, EventArgs e) { - if (areaComboBox.SelectedIndex == 1) + RefreshAreaInfo(); + } + + private void RefreshAreaInfo() + { + if (areaComboBox.SelectedIndex == areaComboBox.Items.Count - 1) { areaForm.Show(); - widthNumeric.Text = (areaForm.Width - 2).ToString(); - heightNumeric.Text = (areaForm.Height - 2).ToString(); + widthNumeric.Text = areaForm.Width.ToString(); + heightNumeric.Text = areaForm.Height.ToString(); + xNumeric.Text = areaForm.Left.ToString(); + yNumeric.Text = areaForm.Top.ToString(); widthNumeric.Enabled = true; heightNumeric.Enabled = true; + xNumeric.Enabled = true; + yNumeric.Enabled = true; + + hideTaskbarCheckBox.Enabled = false; } else { @@ -293,9 +374,61 @@ private void areaComboBox_SelectedIndexChanged(object sender, EventArgs e) widthNumeric.Enabled = false; heightNumeric.Enabled = false; + xNumeric.Enabled = false; + yNumeric.Enabled = false; + + hideTaskbarCheckBox.Enabled = true; - widthNumeric.Text = Screen.PrimaryScreen.Bounds.Width.ToString(); - heightNumeric.Text = Screen.PrimaryScreen.Bounds.Height.ToString(); + if (Screen.AllScreens.Length > 1) + { + if (areaComboBox.SelectedIndex == areaComboBox.Items.Count - 2) + { + widthNumeric.Text = SystemInformation.VirtualScreen.Width.ToString(); + heightNumeric.Text = SystemInformation.VirtualScreen.Height.ToString(); + xNumeric.Text = SystemInformation.VirtualScreen.Left.ToString(); + yNumeric.Text = SystemInformation.VirtualScreen.Top.ToString(); + + hideTaskbarCheckBox.Enabled = false; + } + else + { + hideTaskbarCheckBox.Enabled = true; + + if (hideTaskbarCheckBox.Checked) + { + widthNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].WorkingArea.Width.ToString(); + heightNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].WorkingArea.Height.ToString(); + xNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].WorkingArea.X.ToString(); + yNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].WorkingArea.Y.ToString(); + } + else + { + widthNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].Bounds.Width.ToString(); + heightNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].Bounds.Height.ToString(); + xNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].Bounds.X.ToString(); + yNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].Bounds.Y.ToString(); + } + } + } + else + { + if (hideTaskbarCheckBox.Checked) + { + widthNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].WorkingArea.Width.ToString(); + heightNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].WorkingArea.Height.ToString(); + xNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].WorkingArea.X.ToString(); + yNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].WorkingArea.Y.ToString(); + } + else + { + widthNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].Bounds.Width.ToString(); + heightNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].Bounds.Height.ToString(); + xNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].Bounds.X.ToString(); + yNumeric.Text = Screen.AllScreens[areaComboBox.SelectedIndex].Bounds.Y.ToString(); + } + + hideTaskbarCheckBox.Enabled = true; + } } } @@ -303,7 +436,7 @@ private void widthNumeric_ValueChanged(object sender, EventArgs e) { if (widthNumeric.Enabled) { - areaForm.Width = (int)widthNumeric.Value + 2; + areaForm.Width = (int)widthNumeric.Value; } } @@ -311,7 +444,7 @@ private void heightNumeric_ValueChanged(object sender, EventArgs e) { if (heightNumeric.Enabled) { - areaForm.Height = (int)heightNumeric.Value + 2; + areaForm.Height = (int)heightNumeric.Value; } } @@ -320,6 +453,9 @@ private void MainForm_Load(object sender, EventArgs e) HotkeyManager.RegisterHotKey(this.Handle, 0, (int)HotkeyManager.KeyModifier.Alt, Keys.R.GetHashCode()); onTopBtn.Checked = Properties.Settings.Default.AlwaysOnTop; + qualityComboBox.SelectedIndex = Properties.Settings.Default.QualityIndex; + captureCursorCheckBox.Checked = Properties.Settings.Default.CaptureCursor; + hideTaskbarCheckBox.Checked = Properties.Settings.Default.HideTaskbar; } protected override void WndProc(ref Message m) @@ -335,7 +471,7 @@ protected override void WndProc(ref Message m) { if (key == Keys.R) { - StartRec(); + CheckStartRec(); } } } @@ -378,6 +514,39 @@ private void RefreshAudioDevices() } } + private void RefreshScreens() + { + areaComboBox.Items.Clear(); + + for (int i = 0; i < Screen.AllScreens.Length; i++) + { + if (Screen.AllScreens[i].Primary) + { + areaComboBox.Items.Add("Primary screen (" + Screen.AllScreens[i].Bounds.Width + "x" + Screen.AllScreens[i].Bounds.Height + ")"); + } + else + { + areaComboBox.Items.Add("Screen " + (i + 1) + " (" + Screen.AllScreens[i].Bounds.Width + "x" + Screen.AllScreens[i].Bounds.Height + ")"); + } + } + + if (Screen.AllScreens.Length > 1) + { + areaComboBox.Items.Add("Everything"); + } + + areaComboBox.Items.Add("Custom area"); + + areaComboBox.SelectedIndex = 0; + + widthNumeric.Maximum = SystemInformation.VirtualScreen.Width; + heightNumeric.Maximum = SystemInformation.VirtualScreen.Height; + //xNumeric.Maximum = SystemInformation.VirtualScreen.Width - areaForm.MinimumSize.Width; + //yNumeric.Maximum = SystemInformation.VirtualScreen.Height - areaForm.MinimumSize.Height; + + areaForm.SetMaximumArea(SystemInformation.VirtualScreen.Width, SystemInformation.VirtualScreen.Height); + } + private void settingsBtn_Click(object sender, EventArgs e) { SettingsForm settingsBox = new SettingsForm(darkMode); @@ -393,5 +562,45 @@ private void inputDeviceComboBox_SelectedIndexChanged(object sender, EventArgs e { separateAudioCheckBox.Enabled = inputDeviceComboBox.SelectedIndex != 0; } + + private void xNumeric_ValueChanged(object sender, EventArgs e) + { + if (xNumeric.Enabled) + { + areaForm.Left = (int)xNumeric.Value; + } + } + + private void yNumeric_ValueChanged(object sender, EventArgs e) + { + if (yNumeric.Enabled) + { + areaForm.Top = (int)yNumeric.Value; + } + } + + private void hideTaskbarCheckBox_CheckedChanged(object sender, EventArgs e) + { + RefreshAreaInfo(); + Properties.Settings.Default.HideTaskbar = hideTaskbarCheckBox.Checked; + Properties.Settings.Default.Save(); + } + + private void refreshScreensBtn_Click(object sender, EventArgs e) + { + RefreshScreens(); + } + + private void captureCursorCheckBox_CheckedChanged(object sender, EventArgs e) + { + Properties.Settings.Default.CaptureCursor = captureCursorCheckBox.Checked; + Properties.Settings.Default.Save(); + } + + private void qualityComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + Properties.Settings.Default.QualityIndex = qualityComboBox.SelectedIndex; + Properties.Settings.Default.Save(); + } } } diff --git a/quick-screen-recorder/MainForm.resx b/quick-screen-recorder/MainForm.resx index 8e32288..f8ac0de 100644 --- a/quick-screen-recorder/MainForm.resx +++ b/quick-screen-recorder/MainForm.resx @@ -121,7 +121,17 @@ 138, 17 - + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAOJJREFUOE+lkktqAkEURXtiUIJKprqWRBFciw7iQJ34WUFciyMRXYLgD3UhopJB + ZnpuPyX2ryLmwKFu0d1FVfX1HqBzHZ/mjF8WH+MF67jAPWoBWcI/KeIah/iOb6iPWyg+sWAxShq32PZn + v9zfQR83mPJnIZo4suhkgtpJhCV+WHRSxZnFIN/4atFJHg8WgxwxZ9FJFk8Wg2hbFYtOyhh7hAaOLTrR + JaonEVSgHfb8mdG9jjf0TD3Ru7GoJNqJGKBKlEH9nSmuMLFI9+ictwr/4BxrGFugJFRfLfAvwncQwvMu + vNonXS1zg0cAAAAASUVORK5CYII= + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO wwAADsMBx2+oZAAAAOJJREFUOE+lkktqAkEURXtiUIJKprqWRBFciw7iQJ34WUFciyMRXYLgD3UhopJB diff --git a/quick-screen-recorder/Properties/Settings.Designer.cs b/quick-screen-recorder/Properties/Settings.Designer.cs index 1cc4d0b..1dc3022 100644 --- a/quick-screen-recorder/Properties/Settings.Designer.cs +++ b/quick-screen-recorder/Properties/Settings.Designer.cs @@ -46,5 +46,41 @@ public bool AlwaysOnTop { this["AlwaysOnTop"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2")] + public int QualityIndex { + get { + return ((int)(this["QualityIndex"])); + } + set { + this["QualityIndex"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool CaptureCursor { + get { + return ((bool)(this["CaptureCursor"])); + } + set { + this["CaptureCursor"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool HideTaskbar { + get { + return ((bool)(this["HideTaskbar"])); + } + set { + this["HideTaskbar"] = value; + } + } } } diff --git a/quick-screen-recorder/Properties/Settings.settings b/quick-screen-recorder/Properties/Settings.settings index 7441c97..0a03b16 100644 --- a/quick-screen-recorder/Properties/Settings.settings +++ b/quick-screen-recorder/Properties/Settings.settings @@ -8,5 +8,14 @@ True + + 2 + + + True + + + False + \ No newline at end of file diff --git a/quick-screen-recorder/Recorder.cs b/quick-screen-recorder/Recorder.cs index bf31ecd..85d84ce 100644 --- a/quick-screen-recorder/Recorder.cs +++ b/quick-screen-recorder/Recorder.cs @@ -61,7 +61,7 @@ private struct CURSORINFO public bool Mute = false; public Recorder(string filePath, - int quality, int x, int y, int width, int height, bool captureCursor, + int quality, int x, int y, int width, int height, bool captureCursor, int inputSourceIndex, bool separateAudio) { this.x = x; @@ -76,8 +76,16 @@ public Recorder(string filePath, EmitIndex1 = true, }; - videoStream = writer.AddMotionJpegVideoStream(width, height, quality); - videoStream.Name = "Quick Screen Recorder - Video stream"; + if (quality == 0) + { + videoStream = writer.AddUncompressedVideoStream(width, height); + videoStream.Name = "Quick Screen Recorder - Motion JPEG video stream"; + } + else + { + videoStream = writer.AddMotionJpegVideoStream(width, height, quality); + videoStream.Name = "Quick Screen Recorder - Motion JPEG video stream"; + } if (inputSourceIndex >= 0) { diff --git a/quick-screen-recorder/StopForm.Designer.cs b/quick-screen-recorder/StopForm.Designer.cs index f7651c5..d1fa985 100644 --- a/quick-screen-recorder/StopForm.Designer.cs +++ b/quick-screen-recorder/StopForm.Designer.cs @@ -37,7 +37,7 @@ private void InitializeComponent() this.audioLabel = new System.Windows.Forms.Label(); this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.volumeLabel = new System.Windows.Forms.Label(); - this.muteCheckBox = new System.Windows.Forms.CheckBox(); + this.muteCheckBox = new quick_screen_recorder.CustomCheckBox(); this.SuspendLayout(); // // timeLabel @@ -111,8 +111,7 @@ private void InitializeComponent() // // muteCheckBox // - this.muteCheckBox.AutoSize = true; - this.muteCheckBox.Location = new System.Drawing.Point(166, 125); + this.muteCheckBox.Location = new System.Drawing.Point(166, 127); this.muteCheckBox.Name = "muteCheckBox"; this.muteCheckBox.Size = new System.Drawing.Size(99, 19); this.muteCheckBox.TabIndex = 29; @@ -124,7 +123,7 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(274, 151); + this.ClientSize = new System.Drawing.Size(274, 152); this.Controls.Add(this.muteCheckBox); this.Controls.Add(this.volumeLabel); this.Controls.Add(this.progressBar1); @@ -156,6 +155,6 @@ private void InitializeComponent() private System.Windows.Forms.Label audioLabel; private System.Windows.Forms.ProgressBar progressBar1; private System.Windows.Forms.Label volumeLabel; - private System.Windows.Forms.CheckBox muteCheckBox; + private CustomCheckBox muteCheckBox; } } \ No newline at end of file diff --git a/quick-screen-recorder/StopForm.cs b/quick-screen-recorder/StopForm.cs index be32ef7..2a43018 100644 --- a/quick-screen-recorder/StopForm.cs +++ b/quick-screen-recorder/StopForm.cs @@ -24,6 +24,11 @@ public StopForm(DateTime startTime, bool darkMode, string videoStr, string audio videoLabel.Text = string.Format(videoLabel.Text, videoStr); audioLabel.Text = string.Format(audioLabel.Text, audioStr); + if (audioStr == "None") + { + muteCheckBox.Enabled = false; + } + if (darkMode) { this.ForeColor = Color.White; @@ -31,6 +36,8 @@ public StopForm(DateTime startTime, bool darkMode, string videoStr, string audio stopButton.BackColor = ThemeManager.DarkSecondColor; stopButton.Image = Properties.Resources.white_stop; + + muteCheckBox.SetDarkMode(true); } } @@ -113,6 +120,7 @@ public void UpdateVolumeBar(int volume) private void muteCheckBox_CheckedChanged(object sender, EventArgs e) { + Console.WriteLine("a"); (this.Owner as MainForm).MuteRecorder(muteCheckBox.Checked); } } diff --git a/quick-screen-recorder/bin/Debug/quick-screen-recorder.exe b/quick-screen-recorder/bin/Debug/quick-screen-recorder.exe index b7f435f..e910604 100644 Binary files a/quick-screen-recorder/bin/Debug/quick-screen-recorder.exe and b/quick-screen-recorder/bin/Debug/quick-screen-recorder.exe differ diff --git a/quick-screen-recorder/bin/Debug/quick-screen-recorder.exe.config b/quick-screen-recorder/bin/Debug/quick-screen-recorder.exe.config index 533729f..9f8d47f 100644 --- a/quick-screen-recorder/bin/Debug/quick-screen-recorder.exe.config +++ b/quick-screen-recorder/bin/Debug/quick-screen-recorder.exe.config @@ -16,6 +16,15 @@ True + + 2 + + + True + + + False + \ No newline at end of file diff --git a/quick-screen-recorder/bin/Debug/quick-screen-recorder.pdb b/quick-screen-recorder/bin/Debug/quick-screen-recorder.pdb index f642c9e..c30513a 100644 Binary files a/quick-screen-recorder/bin/Debug/quick-screen-recorder.pdb and b/quick-screen-recorder/bin/Debug/quick-screen-recorder.pdb differ diff --git a/quick-screen-recorder/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/quick-screen-recorder/obj/Debug/DesignTimeResolveAssemblyReferences.cache index b560da0..0bc0f8d 100644 Binary files a/quick-screen-recorder/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/quick-screen-recorder/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/quick-screen-recorder/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/quick-screen-recorder/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll index 8a1354e..1e375ba 100644 Binary files a/quick-screen-recorder/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll and b/quick-screen-recorder/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/quick-screen-recorder/obj/Debug/quick-screen-recorder.csproj.GenerateResource.cache b/quick-screen-recorder/obj/Debug/quick-screen-recorder.csproj.GenerateResource.cache index 88cd69c..043cd51 100644 Binary files a/quick-screen-recorder/obj/Debug/quick-screen-recorder.csproj.GenerateResource.cache and b/quick-screen-recorder/obj/Debug/quick-screen-recorder.csproj.GenerateResource.cache differ diff --git a/quick-screen-recorder/obj/Debug/quick-screen-recorder.csprojAssemblyReference.cache b/quick-screen-recorder/obj/Debug/quick-screen-recorder.csprojAssemblyReference.cache index 3a70a9d..c5205b0 100644 Binary files a/quick-screen-recorder/obj/Debug/quick-screen-recorder.csprojAssemblyReference.cache and b/quick-screen-recorder/obj/Debug/quick-screen-recorder.csprojAssemblyReference.cache differ diff --git a/quick-screen-recorder/obj/Debug/quick-screen-recorder.exe b/quick-screen-recorder/obj/Debug/quick-screen-recorder.exe index b7f435f..e910604 100644 Binary files a/quick-screen-recorder/obj/Debug/quick-screen-recorder.exe and b/quick-screen-recorder/obj/Debug/quick-screen-recorder.exe differ diff --git a/quick-screen-recorder/obj/Debug/quick-screen-recorder.pdb b/quick-screen-recorder/obj/Debug/quick-screen-recorder.pdb index f642c9e..c30513a 100644 Binary files a/quick-screen-recorder/obj/Debug/quick-screen-recorder.pdb and b/quick-screen-recorder/obj/Debug/quick-screen-recorder.pdb differ diff --git a/quick-screen-recorder/obj/Debug/quick_screen_recorder.MainForm.resources b/quick-screen-recorder/obj/Debug/quick_screen_recorder.MainForm.resources index 88d7be5..47a3423 100644 Binary files a/quick-screen-recorder/obj/Debug/quick_screen_recorder.MainForm.resources and b/quick-screen-recorder/obj/Debug/quick_screen_recorder.MainForm.resources differ