Skip to content

Commit dd8f489

Browse files
committed
Multimonitor support & More...
- 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
1 parent 7787d34 commit dd8f489

26 files changed

+532
-113
lines changed

.vs/quick-screen-recorder/v16/.suo

10.5 KB
Binary file not shown.
28 KB
Binary file not shown.
-32 KB
Binary file not shown.
-1.89 MB
Binary file not shown.

quick-screen-recorder/App.config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
<setting name="AlwaysOnTop" serializeAs="String">
1717
<value>True</value>
1818
</setting>
19+
<setting name="QualityIndex" serializeAs="String">
20+
<value>2</value>
21+
</setting>
22+
<setting name="CaptureCursor" serializeAs="String">
23+
<value>True</value>
24+
</setting>
25+
<setting name="HideTaskbar" serializeAs="String">
26+
<value>False</value>
27+
</setting>
1928
</quick_screen_recorder.Properties.Settings>
2029
</userSettings>
2130
</configuration>

quick-screen-recorder/AreaForm.Designer.cs

Lines changed: 20 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

quick-screen-recorder/AreaForm.cs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ public partial class AreaForm : Form
1818
private Point startPos;
1919
private Size curSize;
2020

21-
System.Timers.Timer resizeTimer = new System.Timers.Timer();
21+
private System.Timers.Timer resizeTimer = new System.Timers.Timer();
22+
23+
private int maxWidth = 4096;
24+
private int maxHeight = 4096;
2225

2326
public AreaForm()
2427
{
@@ -36,8 +39,11 @@ private void resizeTimer_Elapsed(object sender, ElapsedEventArgs e)
3639
int newWidth = curSize.Width + curPos.X - startPos.X;
3740
int newHeight = curSize.Height + curPos.Y - startPos.Y;
3841

39-
(this.Owner as MainForm).SetAreaWidth(newWidth - 2);
40-
(this.Owner as MainForm).SetAreaHeight(newHeight - 2);
42+
if (newWidth > 4096) newWidth = 4096;
43+
if (newHeight > 4096) newHeight = 4096;
44+
45+
(this.Owner as MainForm).SetAreaWidth(newWidth);
46+
(this.Owner as MainForm).SetAreaHeight(newHeight);
4147
}));
4248
}
4349

@@ -77,11 +83,29 @@ private void AreaForm_MouseUp(object sender, MouseEventArgs e)
7783
private void AreaForm_SizeChanged(object sender, EventArgs e)
7884
{
7985
this.Refresh();
86+
(this.Owner as MainForm).SetMaximumX(maxWidth - this.Width);
87+
(this.Owner as MainForm).SetMaximumY(maxHeight - this.Height);
8088
}
8189

8290
private void AreaForm_LocationChanged(object sender, EventArgs e)
8391
{
84-
sizeBtn.Text = "X:" + (this.Location.X + 1) + "\nY:" + (this.Location.Y + 1);
92+
(this.Owner as MainForm).SetAreaX(this.Left);
93+
(this.Owner as MainForm).SetAreaY(this.Top);
94+
}
95+
96+
public void SetMaximumArea(int maxW, int maxH)
97+
{
98+
maxWidth = maxW;
99+
maxHeight = maxH;
100+
}
101+
102+
private void AreaForm_ResizeEnd(object sender, EventArgs e)
103+
{
104+
if (this.Left < 0) this.Left = 0;
105+
if (this.Top < 0) this.Top = 0;
106+
107+
if (this.Left + this.Width > maxWidth) this.Left = maxWidth - this.Width;
108+
if (this.Top + this.Height > maxHeight) this.Top = maxHeight - this.Height;
85109
}
86110
}
87111
}

quick-screen-recorder/CustomComboBox.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ protected override void OnPaint(PaintEventArgs e)
5757
protected override void OnDrawItem(DrawItemEventArgs e)
5858
{
5959
e.DrawBackground();
60-
e.Graphics.DrawString(this.Items[e.Index].ToString(), this.Font, new SolidBrush(this.ForeColor), e.Bounds.X, e.Bounds.Y);
60+
if (e.Index != -1)
61+
{
62+
e.Graphics.DrawString(this.Items[e.Index].ToString(), this.Font, new SolidBrush(this.ForeColor), e.Bounds.X, e.Bounds.Y);
63+
}
6164
}
6265
}
6366
}

0 commit comments

Comments
 (0)