|
@@ -82,6 +82,7 @@ namespace XHWK.WKTool
|
82
|
82
|
/// 计时用
|
83
|
83
|
/// </summary>
|
84
|
84
|
private TimeSpan _timeSpan = new TimeSpan(0, 0, 0, 0, 0);
|
|
85
|
+
|
85
|
86
|
#region 上传
|
86
|
87
|
/// <summary>
|
87
|
88
|
/// 视频模型
|
|
@@ -884,6 +885,7 @@ namespace XHWK.WKTool
|
884
|
885
|
try
|
885
|
886
|
{
|
886
|
887
|
Record();
|
|
888
|
+ HideAngleBorder();
|
887
|
889
|
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
888
|
890
|
ofd = new System.Windows.Forms.OpenFileDialog
|
889
|
891
|
{
|
|
@@ -1767,6 +1769,15 @@ namespace XHWK.WKTool
|
1767
|
1769
|
/// 是否录制了音频
|
1768
|
1770
|
/// </summary>
|
1769
|
1771
|
private bool IsRecordAudio = false;
|
|
1772
|
+
|
|
1773
|
+ /// <summary>
|
|
1774
|
+ /// 截图定时器
|
|
1775
|
+ /// </summary>
|
|
1776
|
+ private System.Threading.Timer timer;
|
|
1777
|
+ /// <summary>
|
|
1778
|
+ /// 录制计时
|
|
1779
|
+ /// </summary>
|
|
1780
|
+ private DateTime SRTime = DateTime.Now;
|
1770
|
1781
|
#endregion
|
1771
|
1782
|
|
1772
|
1783
|
#region 录屏
|
|
@@ -1899,8 +1910,6 @@ namespace XHWK.WKTool
|
1899
|
1910
|
EndRecord();
|
1900
|
1911
|
}
|
1901
|
1912
|
|
1902
|
|
- private System.Timers.Timer timer;
|
1903
|
|
-
|
1904
|
1913
|
/// <summary>
|
1905
|
1914
|
/// 设置录屏文件地址
|
1906
|
1915
|
/// </summary>
|
|
@@ -1961,15 +1970,16 @@ namespace XHWK.WKTool
|
1961
|
1970
|
#endregion
|
1962
|
1971
|
|
1963
|
1972
|
#region 计时器初始化
|
1964
|
|
- if (t == null)
|
1965
|
|
- {
|
1966
|
|
- t = new DispatcherTimer();
|
1967
|
|
- t.Tick += OnTimer;
|
1968
|
|
- t.Interval = new TimeSpan(0, 0, 0, 1);
|
1969
|
|
- t.IsEnabled = true;
|
1970
|
|
- t.Start();
|
1971
|
|
- }
|
1972
|
|
- t.Interval = new TimeSpan(0, 0, 0, 1);
|
|
1973
|
+
|
|
1974
|
+ //if (t == null)
|
|
1975
|
+ //{
|
|
1976
|
+ // t = new DispatcherTimer();
|
|
1977
|
+ // t.Tick += OnTimer;
|
|
1978
|
+ // t.Interval = new TimeSpan(0, 0, 0, 1);
|
|
1979
|
+ // t.IsEnabled = true;
|
|
1980
|
+ // t.Start();
|
|
1981
|
+ //}
|
|
1982
|
+ //t.Interval = new TimeSpan(0, 0, 0, 1);
|
1973
|
1983
|
txbTime.Visibility = Visibility.Visible;
|
1974
|
1984
|
#endregion
|
1975
|
1985
|
|
|
@@ -2079,12 +2089,14 @@ namespace XHWK.WKTool
|
2079
|
2089
|
#endregion
|
2080
|
2090
|
IsFirstR = false;
|
2081
|
2091
|
RsImgName = new List<string>();
|
2082
|
|
- timer = new System.Timers.Timer(200)
|
2083
|
|
- {
|
2084
|
|
- AutoReset = true//设置是否执行System.Timers.Timer.Elapsed事件
|
2085
|
|
- };//设置执行一次(false)还是一直执行(true)
|
2086
|
|
- timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
|
2087
|
|
- timer.Enabled = true; //启动计时器
|
|
2092
|
+ ///启动截图
|
|
2093
|
+ timer = new System.Threading.Timer(new TimerCallback(Timer_Elapsed), null, 0, 200);
|
|
2094
|
+ SRTime = Convert.ToDateTime("2020-01-01 00:00:00");
|
|
2095
|
+ //{
|
|
2096
|
+ // AutoReset = true//设置是否执行System.Timers.Timer.Elapsed事件
|
|
2097
|
+ //};//设置执行一次(false)还是一直执行(true)
|
|
2098
|
+ //timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
|
|
2099
|
+ //timer.Enabled = true; //启动计时器
|
2088
|
2100
|
}
|
2089
|
2101
|
|
2090
|
2102
|
//继续录制
|
|
@@ -2120,7 +2132,7 @@ namespace XHWK.WKTool
|
2120
|
2132
|
Dispatcher.Invoke(() =>
|
2121
|
2133
|
{
|
2122
|
2134
|
IsStartCount = true;
|
2123
|
|
- Stack();
|
|
2135
|
+ //Stack();
|
2124
|
2136
|
//timer.Start();
|
2125
|
2137
|
});
|
2126
|
2138
|
}))).Start();
|
|
@@ -2138,7 +2150,7 @@ namespace XHWK.WKTool
|
2138
|
2150
|
ImgStop.Visibility = Visibility.Visible;
|
2139
|
2151
|
ImgStopTwo.Visibility = Visibility.Collapsed;
|
2140
|
2152
|
TxbRecordingWord.Text = "继续";
|
2141
|
|
- TimeOut();
|
|
2153
|
+ //TimeOut();
|
2142
|
2154
|
#region 2秒内不可点击
|
2143
|
2155
|
new Thread(new ThreadStart(new Action(() =>
|
2144
|
2156
|
{
|
|
@@ -2177,8 +2189,7 @@ namespace XHWK.WKTool
|
2177
|
2189
|
/// 录制保存图片
|
2178
|
2190
|
/// </summary>
|
2179
|
2191
|
/// <param name="sender"></param>
|
2180
|
|
- /// <param name="e"></param>
|
2181
|
|
- private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
|
2192
|
+ private void Timer_Elapsed(object sender)
|
2182
|
2193
|
{
|
2183
|
2194
|
if (IsStartCount)
|
2184
|
2195
|
{
|
|
@@ -2187,8 +2198,17 @@ namespace XHWK.WKTool
|
2187
|
2198
|
Dispatcher.Invoke(() =>
|
2188
|
2199
|
{
|
2189
|
2200
|
string FilePathName = ImgPath + RsImgName.Count + ".png";
|
2190
|
|
- ImageHelper.SaveUIToImage(GridMain, FilePathName, (int)ActualWidth, (int)ActualHeight);
|
2191
|
2201
|
RsImgName.Add(FilePathName);
|
|
2202
|
+ ImageHelper.SaveUIToImage(GridMain, FilePathName, (int)ActualWidth, (int)ActualHeight);
|
|
2203
|
+ SRTime=SRTime.AddMilliseconds(200);
|
|
2204
|
+ if (SRTime.Hour > 0)
|
|
2205
|
+ {
|
|
2206
|
+ txbTime.Text = SRTime.ToString("HH:mm:ss");
|
|
2207
|
+ }
|
|
2208
|
+ else
|
|
2209
|
+ {
|
|
2210
|
+ txbTime.Text = SRTime.ToString("mm:ss");
|
|
2211
|
+ }
|
2192
|
2212
|
});
|
2193
|
2213
|
}
|
2194
|
2214
|
catch (Exception ex)
|
|
@@ -2241,7 +2261,7 @@ namespace XHWK.WKTool
|
2241
|
2261
|
ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
|
2242
|
2262
|
ImgStop.Visibility = Visibility.Visible;
|
2243
|
2263
|
ImgStopTwo.Visibility = Visibility.Collapsed;
|
2244
|
|
- TimeOut();
|
|
2264
|
+ //TimeOut();
|
2245
|
2265
|
txbType.Text = "保存中";
|
2246
|
2266
|
#region 2秒内不可点击
|
2247
|
2267
|
new Thread(new ThreadStart(new Action(() =>
|
|
@@ -2298,8 +2318,9 @@ namespace XHWK.WKTool
|
2298
|
2318
|
Dispatcher.Invoke(() =>
|
2299
|
2319
|
{
|
2300
|
2320
|
IsStartCount = false;
|
2301
|
|
- timer.Stop();
|
2302
|
|
- End();
|
|
2321
|
+ timer.Change(-1, 0);
|
|
2322
|
+ timer.Dispose();
|
|
2323
|
+ //End();
|
2303
|
2324
|
txbTime.Text = "";
|
2304
|
2325
|
txbTime.Visibility = Visibility.Hidden;
|
2305
|
2326
|
});
|
|
@@ -3911,6 +3932,19 @@ namespace XHWK.WKTool
|
3911
|
3932
|
float x = PrimaryScreen.ScaleX;
|
3912
|
3933
|
float y = PrimaryScreen.ScaleY;
|
3913
|
3934
|
}
|
|
3935
|
+ /// <summary>
|
|
3936
|
+ /// 点击标题栏 隐藏截图的四个点和线
|
|
3937
|
+ /// </summary>
|
|
3938
|
+ /// <param name="sender"></param>
|
|
3939
|
+ /// <param name="e"></param>
|
|
3940
|
+ private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
|
|
3941
|
+ {
|
|
3942
|
+ HideAngleBorder();
|
|
3943
|
+ }
|
3914
|
3944
|
|
|
3945
|
+ private void Button_Click_1(object sender, RoutedEventArgs e)
|
|
3946
|
+ {
|
|
3947
|
+ Thread.Sleep(2000);
|
|
3948
|
+ }
|
3915
|
3949
|
}
|
3916
|
3950
|
}
|