-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathFormRecMini.cs
More file actions
85 lines (77 loc) · 2.17 KB
/
FormRecMini.cs
File metadata and controls
85 lines (77 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using ScreenRecoder.App.Api;
using System;
using System.Drawing;
using System.Windows.Forms;
namespace ScreenRecoder.App
{
//迷你录制窗口
public partial class FormRecMini : Form
{
public FormRecMini()
{
InitializeComponent();
}
public void SetTime(string s)
{
lb_time.Text = s;
}
public void SetPlayPause(bool p)
{
if(p)
{
toolTip1.SetToolTip(btn_pause, "暂停录像");
}
else
{
toolTip1.SetToolTip(btn_pause, "继续录像");
}
}
public void SetPauseIcon(Image i)
{
btn_pause.Icon = i;
btn_pause.Invalidate();
}
public void SetStopIcon(Image i)
{
btn_stop.Icon = i;
btn_stop.Invalidate();
}
private void btn_stop_BtnClick(object sender, EventArgs e)
{
FormMain.formMain.btn_stop_BtnClick(sender, e);
}
private void btn_pause_BtnClick(object sender, EventArgs e)
{
FormMain.formMain.btn_pause_BtnClick(sender, e);
}
private void btn_huge_BtnClick(object sender, EventArgs e)
{
WindowUtils.Hide(Handle);
WindowUtils.Show(FormMain.formMain.Handle);
}
private void lb_time_MouseDown(object sender, MouseEventArgs e)
{
WindowUtils.Move(Handle);
}
private void FormRecMini_Load(object sender, EventArgs e)
{
Height = 36;
lb_time.Height = 36;
}
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= API.WS_EX_TOOLWINDOW;
return cp;
}
}
//窗口背景和边框绘画
private Pen borderPen = new Pen(Color.FromArgb(66, 66, 66));
private void FormRecMini_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawRectangle(borderPen, new Rectangle(0, 0, Width - 1, Height - 1));
}
}
}