|
@@ -58,6 +58,10 @@ namespace XHWK.WKTool
|
58
|
58
|
private TimeSpan _timeSpan = new TimeSpan(0, 0, 0, 0, 0);
|
59
|
59
|
|
60
|
60
|
KeyboardHookCommon k_hook;
|
|
61
|
+ /// <summary>
|
|
62
|
+ /// 🖊状态 0红色 1蓝色 10红色批注内 11蓝色批注内
|
|
63
|
+ /// </summary>
|
|
64
|
+ public int flg = 0;
|
61
|
65
|
#endregion
|
62
|
66
|
|
63
|
67
|
#region 初始化
|
|
@@ -87,7 +91,17 @@ namespace XHWK.WKTool
|
87
|
91
|
gridToolbar.Visibility = Visibility.Hidden;
|
88
|
92
|
gridColour.Visibility = Visibility.Hidden;
|
89
|
93
|
gridThickness.Visibility = Visibility.Hidden;
|
90
|
|
- ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar26.png"));
|
|
94
|
+
|
|
95
|
+ ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar26.png"));//大圆圈三角形
|
|
96
|
+ ImgEndRecordingScreen.Source= new BitmapImage(new Uri("pack://application:,,,/Images/Toobar15.png"));
|
|
97
|
+ BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
|
|
98
|
+ imgBlackPenOne.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
|
|
99
|
+ btnBlackPenOne.IsEnabled = false;//蓝笔不可点击
|
|
100
|
+ imgBlackPenTwo.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
|
|
101
|
+ btnBlackPenTwo.IsEnabled = false;//红笔不可点击
|
|
102
|
+ imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar29.png"));
|
|
103
|
+ btnReturn.IsEnabled = true;//返回主界面可点击
|
|
104
|
+ txbTime.Visibility = Visibility.Hidden;//时间不显示
|
91
|
105
|
if (t == null)
|
92
|
106
|
{
|
93
|
107
|
t = new DispatcherTimer();
|
|
@@ -114,6 +128,7 @@ namespace XHWK.WKTool
|
114
|
128
|
//结束
|
115
|
129
|
BtnStopRecordingScreen_Click(null, null);
|
116
|
130
|
}
|
|
131
|
+
|
117
|
132
|
}
|
118
|
133
|
#endregion
|
119
|
134
|
|
|
@@ -186,9 +201,9 @@ namespace XHWK.WKTool
|
186
|
201
|
FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "tempsr/");
|
187
|
202
|
VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
|
188
|
203
|
int num = 1;
|
189
|
|
- while(FileToolsCommon.IsExistFile(VideoSavePathName))
|
|
204
|
+ while (FileToolsCommon.IsExistFile(VideoSavePathName))
|
190
|
205
|
{
|
191
|
|
- VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_"+ num + "." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
|
|
206
|
+ VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + "." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
|
192
|
207
|
num++;
|
193
|
208
|
}
|
194
|
209
|
}
|
|
@@ -227,8 +242,17 @@ namespace XHWK.WKTool
|
227
|
242
|
//APP.W_CountdownWindow.Show();
|
228
|
243
|
//#endregion
|
229
|
244
|
|
230
|
|
- ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));
|
231
|
|
- txbTime.Visibility = Visibility.Visible;
|
|
245
|
+
|
|
246
|
+ ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));//播放状态
|
|
247
|
+ ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar14.png"));
|
|
248
|
+ BtnStopRecordingScreen.IsEnabled = true; //停止录制按钮可点击
|
|
249
|
+ imgBlackPenOne.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar27.png"));
|
|
250
|
+ btnBlackPenOne.IsEnabled = true;//蓝笔可点击
|
|
251
|
+ imgBlackPenTwo.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar28.png"));
|
|
252
|
+ btnBlackPenTwo.IsEnabled = true;//红笔可点击
|
|
253
|
+ imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar30.png"));
|
|
254
|
+ btnReturn.IsEnabled = false;//返回主界面不可点击
|
|
255
|
+ txbTime.Visibility = Visibility.Visible;//时间显示
|
232
|
256
|
try
|
233
|
257
|
{
|
234
|
258
|
new Thread(new ThreadStart(new Action(() =>
|
|
@@ -245,7 +269,14 @@ namespace XHWK.WKTool
|
245
|
269
|
{
|
246
|
270
|
TimeOut();
|
247
|
271
|
IsSuspend = true;
|
248
|
|
- ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
|
|
272
|
+ ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar26.png"));//大圆圈三角形
|
|
273
|
+ ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar15.png"));
|
|
274
|
+ BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
|
|
275
|
+ imgBlackPenOne.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
|
|
276
|
+ btnBlackPenOne.IsEnabled = false;//蓝笔不可点击
|
|
277
|
+ imgBlackPenTwo.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
|
|
278
|
+ btnBlackPenTwo.IsEnabled = false;//红笔不可点击
|
|
279
|
+ txbTime.Visibility = Visibility.Hidden;//时间不显示
|
249
|
280
|
#region 2秒内不可点击
|
250
|
281
|
new Thread(new ThreadStart(new Action(() =>
|
251
|
282
|
{
|
|
@@ -257,6 +288,7 @@ namespace XHWK.WKTool
|
257
|
288
|
Thread.Sleep(2000);
|
258
|
289
|
Dispatcher.Invoke(() =>
|
259
|
290
|
{
|
|
291
|
+ ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar14.png"));
|
260
|
292
|
BtnRecordingScreen.IsEnabled = true;
|
261
|
293
|
BtnStopRecordingScreen.IsEnabled = true;
|
262
|
294
|
});
|
|
@@ -282,9 +314,9 @@ namespace XHWK.WKTool
|
282
|
314
|
k_hook.Stop();
|
283
|
315
|
IsSuspend = true;
|
284
|
316
|
txbTime.Text = "00:00";
|
|
317
|
+ txbTime.Visibility = Visibility.Hidden;
|
285
|
318
|
End();
|
286
|
|
- ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));
|
287
|
|
- if (gridToolbar.Visibility==Visibility.Visible)
|
|
319
|
+ if (gridToolbar.Visibility == Visibility.Visible)
|
288
|
320
|
{
|
289
|
321
|
gridToolbar.Visibility = Visibility.Hidden;
|
290
|
322
|
gridColour.Visibility = Visibility.Hidden;
|
|
@@ -372,15 +404,21 @@ namespace XHWK.WKTool
|
372
|
404
|
Directory.CreateDirectory(tempPath);
|
373
|
405
|
}
|
374
|
406
|
string imagePath = Path.Combine(tempPath, time + ".jpg");
|
375
|
|
- //ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath);
|
376
|
|
- if (gridToolbar.Visibility == Visibility.Visible)
|
377
|
|
- {
|
378
|
|
- gridToolbar.Visibility = Visibility.Hidden;
|
379
|
|
- }
|
380
|
|
- else
|
|
407
|
+ ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
|
|
408
|
+
|
|
409
|
+ try
|
381
|
410
|
{
|
382
|
|
- gridToolbar.Visibility = Visibility.Visible;
|
383
|
|
- try
|
|
411
|
+ if (flg == 11)
|
|
412
|
+ {
|
|
413
|
+ flg = 1;
|
|
414
|
+ APP.W_PracticeWindow.Hide();
|
|
415
|
+ }
|
|
416
|
+ else if(flg==10)
|
|
417
|
+ {
|
|
418
|
+ APP.W_PracticeWindow.Blue();
|
|
419
|
+ flg = 11;
|
|
420
|
+ }
|
|
421
|
+ else
|
384
|
422
|
{
|
385
|
423
|
if (APP.W_PracticeWindow == null)
|
386
|
424
|
{
|
|
@@ -393,15 +431,18 @@ namespace XHWK.WKTool
|
393
|
431
|
//practiceWin.Owner = this;
|
394
|
432
|
}
|
395
|
433
|
APP.W_PracticeWindow.Initialize(imagePath);
|
|
434
|
+ flg = 11;
|
|
435
|
+ APP.W_PracticeWindow.Blue();
|
396
|
436
|
APP.W_PracticeWindow.Show();
|
397
|
437
|
}
|
398
|
|
- catch (Exception ex)
|
399
|
|
- {
|
400
|
|
- LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
|
401
|
|
- }
|
402
|
438
|
}
|
|
439
|
+ catch (Exception ex)
|
|
440
|
+ {
|
|
441
|
+ LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
|
|
442
|
+ }
|
|
443
|
+
|
403
|
444
|
//imgCanvas.Source = new BitmapImage(new Uri(imagePath));
|
404
|
|
-
|
|
445
|
+
|
405
|
446
|
}
|
406
|
447
|
/// <summary>
|
407
|
448
|
/// 屏幕宽
|
|
@@ -609,5 +650,124 @@ namespace XHWK.WKTool
|
609
|
650
|
{
|
610
|
651
|
DragMove();
|
611
|
652
|
}
|
|
653
|
+ /// <summary>
|
|
654
|
+ /// 红笔
|
|
655
|
+ /// </summary>
|
|
656
|
+ /// <param name="sender"></param>
|
|
657
|
+ /// <param name="e"></param>
|
|
658
|
+ private void BtnBlackPenTwo_Click(object sender, RoutedEventArgs e)
|
|
659
|
+ {
|
|
660
|
+ string time = GetTimeStamp();
|
|
661
|
+ string tempPath = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
|
|
662
|
+ if (!Directory.Exists(tempPath))
|
|
663
|
+ {
|
|
664
|
+ Directory.CreateDirectory(tempPath);
|
|
665
|
+ }
|
|
666
|
+ string imagePath = Path.Combine(tempPath, time + ".jpg");
|
|
667
|
+ ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
|
|
668
|
+
|
|
669
|
+ try
|
|
670
|
+ {
|
|
671
|
+ if (flg == 10)
|
|
672
|
+ {
|
|
673
|
+ flg = 0;
|
|
674
|
+ APP.W_PracticeWindow.Hide();
|
|
675
|
+ }
|
|
676
|
+ else if(flg==11)
|
|
677
|
+ {
|
|
678
|
+ flg = 10;
|
|
679
|
+ APP.W_PracticeWindow.Red();
|
|
680
|
+ }
|
|
681
|
+ else
|
|
682
|
+ {
|
|
683
|
+ if (APP.W_PracticeWindow == null)
|
|
684
|
+ {
|
|
685
|
+ APP.W_PracticeWindow = new PracticeWindow();
|
|
686
|
+ //APP.W_PracticeWindow.Topmost = true;
|
|
687
|
+ APP.W_PracticeWindow.Width = pwidth;
|
|
688
|
+ APP.W_PracticeWindow.Height = pHeight;
|
|
689
|
+ APP.W_PracticeWindow.Left = 0;
|
|
690
|
+ APP.W_PracticeWindow.Top = 0;
|
|
691
|
+ //practiceWin.Owner = this;
|
|
692
|
+ }
|
|
693
|
+ APP.W_PracticeWindow.Initialize(imagePath);
|
|
694
|
+ flg = 10;
|
|
695
|
+ APP.W_PracticeWindow.Red();
|
|
696
|
+ APP.W_PracticeWindow.Show();
|
|
697
|
+ }
|
|
698
|
+ }
|
|
699
|
+ catch (Exception ex)
|
|
700
|
+ {
|
|
701
|
+ LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
|
|
702
|
+ }
|
|
703
|
+ }
|
|
704
|
+ /// <summary>
|
|
705
|
+ /// 鼠标右键按下事件
|
|
706
|
+ /// </summary>
|
|
707
|
+ /// <param name="sender"></param>
|
|
708
|
+ /// <param name="e"></param>
|
|
709
|
+ private void RightButtonDown()
|
|
710
|
+ {
|
|
711
|
+ if (flg > 9)
|
|
712
|
+ {
|
|
713
|
+ APP.W_PracticeWindow.Hide();
|
|
714
|
+ }
|
|
715
|
+ else
|
|
716
|
+ {
|
|
717
|
+ string time = GetTimeStamp();
|
|
718
|
+ string tempPath = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
|
|
719
|
+ if (!Directory.Exists(tempPath))
|
|
720
|
+ {
|
|
721
|
+ Directory.CreateDirectory(tempPath);
|
|
722
|
+ }
|
|
723
|
+ string imagePath = Path.Combine(tempPath, time + ".jpg");
|
|
724
|
+ ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
|
|
725
|
+
|
|
726
|
+ try
|
|
727
|
+ {
|
|
728
|
+ if (APP.W_PracticeWindow == null)
|
|
729
|
+ {
|
|
730
|
+ APP.W_PracticeWindow = new PracticeWindow();
|
|
731
|
+ //APP.W_PracticeWindow.Topmost = true;
|
|
732
|
+ APP.W_PracticeWindow.Width = pwidth;
|
|
733
|
+ APP.W_PracticeWindow.Height = pHeight;
|
|
734
|
+ APP.W_PracticeWindow.Left = 0;
|
|
735
|
+ APP.W_PracticeWindow.Top = 0;
|
|
736
|
+ //practiceWin.Owner = this;
|
|
737
|
+ }
|
|
738
|
+ APP.W_PracticeWindow.Initialize(imagePath);
|
|
739
|
+
|
|
740
|
+ if (flg == 0)
|
|
741
|
+ {
|
|
742
|
+ flg = 10;
|
|
743
|
+ APP.W_PracticeWindow.Red();
|
|
744
|
+ }
|
|
745
|
+ else
|
|
746
|
+ {
|
|
747
|
+ flg = 11;
|
|
748
|
+ APP.W_PracticeWindow.Blue();
|
|
749
|
+ }
|
|
750
|
+ APP.W_PracticeWindow.Show();
|
|
751
|
+ }
|
|
752
|
+ catch (Exception ex)
|
|
753
|
+ {
|
|
754
|
+ LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
|
|
755
|
+ }
|
|
756
|
+ }
|
|
757
|
+ }
|
|
758
|
+ /// <summary>
|
|
759
|
+ /// 返回主界面
|
|
760
|
+ /// </summary>
|
|
761
|
+ /// <param name="sender"></param>
|
|
762
|
+ /// <param name="e"></param>
|
|
763
|
+ private void BtnReturn_Click(object sender, RoutedEventArgs e)
|
|
764
|
+ {
|
|
765
|
+ if (APP.W_XHMicroLessonSystemWindow == null)
|
|
766
|
+ {
|
|
767
|
+ APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
|
|
768
|
+ }
|
|
769
|
+ APP.W_XHMicroLessonSystemWindow.Show();
|
|
770
|
+ this.Hide();
|
|
771
|
+ }
|
612
|
772
|
}
|
613
|
773
|
}
|