Sfoglia il codice sorgente

zhao:1修改批注不影响ppt和视频播放 2增加录屏录制按钮防止连击

tags/录制修改前
耀 4 anni fa
parent
commit
25b97682da

+ 2
- 1
XHWK.WKTool/PracticeWindow.xaml Vedi File

@@ -10,10 +10,11 @@
10 10
     AllowsTransparency="True"
11 11
     Background="Transparent"
12 12
     Opacity="1"
13
+    Topmost="True"
13 14
     ShowInTaskbar="False"
14 15
     WindowStyle="None">
15 16
     <Grid>
16 17
         <Image x:Name="imgCanvas"/>
17
-        <InkCanvas Grid.Row="0" x:Name="blackboard_canvas" PreviewMouseRightButtonDown="blackboard_canvas_PreviewMouseRightButtonDown" Background="Transparent" Visibility="Visible" Grid.ColumnSpan="2"/>
18
+        <InkCanvas Grid.Row="0" x:Name="blackboard_canvas" PreviewMouseRightButtonDown="blackboard_canvas_PreviewMouseRightButtonDown" Background="#021B1919" Visibility="Visible" Grid.ColumnSpan="2"/>
18 19
     </Grid>
19 20
 </Window>

+ 6
- 5
XHWK.WKTool/PracticeWindow.xaml.cs Vedi File

@@ -42,16 +42,17 @@ namespace XHWK.WKTool
42 42
         {
43 43
             InitializeComponent();
44 44
         }
45
-        public void Initialize(string _imgPath)
45
+        public void Initialize(string _imgPath=null)
46 46
         {
47 47
             flg = 0;
48 48
             blackboard_canvas.Strokes.Clear();
49 49
             blackboard_canvas.UseCustomCursor = true;
50 50
             //blackboard_canvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
51
-            if (File.Exists(_imgPath))
52
-            {
53
-                imgCanvas.Source = new BitmapImage(new Uri(_imgPath));
54
-            }
51
+            //加背景 废弃更利于讲解ppt
52
+            //if (File.Exists(_imgPath))
53
+            //{
54
+            //    imgCanvas.Source = new BitmapImage(new Uri(_imgPath));
55
+            //}
55 56
 
56 57
 
57 58
 

+ 48
- 8
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs Vedi File

@@ -247,12 +247,31 @@ namespace XHWK.WKTool
247 247
             }
248 248
         }
249 249
         /// <summary>
250
+        /// 是否已经按下按钮
251
+        /// </summary>
252
+        bool IsPressButton = false;
253
+        /// <summary>
250 254
         /// 开始或暂停录制
251 255
         /// </summary>
252 256
         /// <param name="sender"></param>
253 257
         /// <param name="e"></param>
254 258
         private void BtnRecordingScreen_Click(object sender, RoutedEventArgs e)
255 259
         {
260
+            #region 防止连击
261
+            if (IsPressButton)
262
+            {
263
+                new Thread(new ThreadStart(new Action(() =>
264
+                {
265
+                    Thread.Sleep(500);
266
+                    IsPressButton = false;
267
+                }))).Start();
268
+                return;
269
+            }
270
+            else
271
+            {
272
+                IsPressButton = true;
273
+            }
274
+            #endregion
256 275
             if (IsSuspend)
257 276
             {
258 277
                 if (IsFirstRS)
@@ -443,6 +462,21 @@ namespace XHWK.WKTool
443 462
         /// <param name="e"></param>
444 463
         private void BtnStopRecordingScreen_Click(object sender, RoutedEventArgs e)
445 464
         {
465
+            #region 防止连击
466
+            if (IsPressButton)
467
+            {
468
+                new Thread(new ThreadStart(new Action(() =>
469
+                {
470
+                    Thread.Sleep(500);
471
+                    IsPressButton = false;
472
+                }))).Start();
473
+                return;
474
+            }
475
+            else
476
+            {
477
+                IsPressButton = true;
478
+            }
479
+            #endregion
446 480
             k_hook.Stop();
447 481
             IsSuspend = true;
448 482
             txbTime.Text = "00:00";
@@ -551,9 +585,11 @@ namespace XHWK.WKTool
551 585
             {
552 586
                 Directory.CreateDirectory(tempPath);
553 587
             }
554
-            string imagePath = Path.Combine(tempPath, time + ".jpg");
555 588
 
556
-            ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
589
+            #region 录屏批注取消画笔
590
+            //string imagePath = Path.Combine(tempPath, time + ".jpg");
591
+            //ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
592
+            #endregion
557 593
 
558 594
             try
559 595
             {
@@ -600,7 +636,7 @@ namespace XHWK.WKTool
600 636
                         };
601 637
                         //practiceWin.Owner = this;
602 638
                     }
603
-                    APP.W_PracticeWindow.Initialize(imagePath);
639
+                    APP.W_PracticeWindow.Initialize();// imagePath);
604 640
                     flg = 11;
605 641
                     APP.W_PracticeWindow.Blue();
606 642
                     APP.W_PracticeWindow.Show();
@@ -833,9 +869,10 @@ namespace XHWK.WKTool
833 869
             {
834 870
                 Directory.CreateDirectory(tempPath);
835 871
             }
872
+            #region 录屏批注取消画笔
836 873
             string imagePath = Path.Combine(tempPath, time + ".jpg");
837
-
838 874
             ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
875
+            #endregion
839 876
             try
840 877
             {
841 878
                 if (flg == 10)
@@ -877,7 +914,7 @@ namespace XHWK.WKTool
877 914
                         };
878 915
                         //practiceWin.Owner = this;
879 916
                     }
880
-                    APP.W_PracticeWindow.Initialize(imagePath);
917
+                    APP.W_PracticeWindow.Initialize();//imagePath);
881 918
                     flg = 10;
882 919
                     APP.W_PracticeWindow.Red();
883 920
                     APP.W_PracticeWindow.Show();
@@ -907,8 +944,11 @@ namespace XHWK.WKTool
907 944
                 {
908 945
                     Directory.CreateDirectory(tempPath);
909 946
                 }
910
-                string imagePath = Path.Combine(tempPath, time + ".jpg");
911
-                ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
947
+
948
+                #region 录屏批注取消画笔
949
+                //string imagePath = Path.Combine(tempPath, time + ".jpg");
950
+                //ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
951
+                #endregion
912 952
 
913 953
                 try
914 954
                 {
@@ -924,7 +964,7 @@ namespace XHWK.WKTool
924 964
                         };
925 965
                         //practiceWin.Owner = this;
926 966
                     }
927
-                    APP.W_PracticeWindow.Initialize(imagePath);
967
+                    APP.W_PracticeWindow.Initialize();//imagePath);
928 968
 
929 969
                     if (flg == 0)
930 970
                     {

+ 31
- 1
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Vedi File

@@ -2685,7 +2685,7 @@ namespace XHWK.WKTool
2685 2685
 
2686 2686
         }
2687 2687
         #endregion
2688
-
2688
+        bool IsPressButton = false;
2689 2689
         /// <summary>
2690 2690
         /// 录制窗口内容
2691 2691
         /// </summary>
@@ -2693,6 +2693,21 @@ namespace XHWK.WKTool
2693 2693
         /// <param name="e"></param>
2694 2694
         private void BtnRecord_Click(object sender, RoutedEventArgs e)
2695 2695
         {
2696
+            #region 防止连击
2697
+            if (IsPressButton)
2698
+            {
2699
+                new Thread(new ThreadStart(new Action(() =>
2700
+                {
2701
+                    Thread.Sleep(500);
2702
+                    IsPressButton = false;
2703
+                }))).Start();
2704
+                return;
2705
+            }
2706
+            else
2707
+            {
2708
+                IsPressButton = true;
2709
+            }
2710
+            #endregion
2696 2711
             Record();
2697 2712
             if (!APP.CheckScreenCapturerRecorder())
2698 2713
             {
@@ -2723,6 +2738,21 @@ namespace XHWK.WKTool
2723 2738
         /// <param name="e"></param>
2724 2739
         private void BtnStop_Click(object sender, RoutedEventArgs e)
2725 2740
         {
2741
+            #region 防止连击
2742
+            if (IsPressButton)
2743
+            {
2744
+                new Thread(new ThreadStart(new Action(() =>
2745
+                {
2746
+                    Thread.Sleep(500);
2747
+                    IsPressButton = false;
2748
+                }))).Start();
2749
+                return;
2750
+            }
2751
+            else
2752
+            {
2753
+                IsPressButton = true;
2754
+            }
2755
+            #endregion
2726 2756
             blackboard_canvas.Visibility = Visibility.Collapsed;
2727 2757
             EndRecord();
2728 2758
         }

Loading…
Annulla
Salva