Skip to content

Commit

Permalink
Multimonitor support & More...
Browse files Browse the repository at this point in the history
- Added location text fields
- Custom area can't be placed outside of the screen
- Multimonitor support
- Added hide taskbar checkbox
- Uncompressed video stream
- Save user settings: Quality, capture cursor, hide taskbar
  • Loading branch information
Beelink committed May 9, 2020
1 parent 7787d34 commit dd8f489
Show file tree
Hide file tree
Showing 26 changed files with 532 additions and 113 deletions.
Binary file modified .vs/quick-screen-recorder/v16/.suo
Binary file not shown.
Binary file modified .vs/quick-screen-recorder/v16/Server/sqlite3/storage.ide
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 9 additions & 0 deletions quick-screen-recorder/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
<setting name="AlwaysOnTop" serializeAs="String">
<value>True</value>
</setting>
<setting name="QualityIndex" serializeAs="String">
<value>2</value>
</setting>
<setting name="CaptureCursor" serializeAs="String">
<value>True</value>
</setting>
<setting name="HideTaskbar" serializeAs="String">
<value>False</value>
</setting>
</quick_screen_recorder.Properties.Settings>
</userSettings>
</configuration>
38 changes: 20 additions & 18 deletions quick-screen-recorder/AreaForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 28 additions & 4 deletions quick-screen-recorder/AreaForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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);
}));
}

Expand Down Expand Up @@ -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;
}
}
}
5 changes: 4 additions & 1 deletion quick-screen-recorder/CustomComboBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Loading

0 comments on commit dd8f489

Please sign in to comment.