瀏覽代碼

截图应用未最小化问题解决

录屏结束后未合并完成直接录制问题解决
倒计时优化
master
张剑 1 年之前
父節點
當前提交
0ad60ca573

+ 2
- 2
XHWK.WKTool/App.config 查看文件

@@ -9,8 +9,8 @@
9 9
     <!--参数是否加密 0不加密 1加密-->
10 10
     <add key="IsParameterEncryption" value="0" />
11 11
     <!--版本号-->
12
-    <add key="VersionCode" value="119" />
13
-    <add key="VersionName" value="3.9.2" />
12
+    <add key="VersionCode" value="120" />
13
+    <add key="VersionName" value="3.9.3" />
14 14
     <!--皮肤样式 0白 1蓝 2黑色 -->
15 15
     <add key="SkinStyle" value="0" />
16 16
     <!--是否输出视频记录日志:0否-->

+ 19
- 13
XHWK.WKTool/CountdownWindow.xaml.cs 查看文件

@@ -30,11 +30,11 @@ namespace XHWK.WKTool
30 30
         /// </summary>
31 31
         private int _imgNum = 22;
32 32
 
33
-        public void Initialize(bool showlblShortcut = false, int changeTime = 3000)
33
+        public void InitAndShow(bool showlblShortcut = false, int changeTime = 3000)
34 34
         {
35
-            imgLoding.Opacity = 0.1;
36 35
             imgLoding.Source = _images.Last();
37 36
             Init(showlblShortcut, changeTime);
37
+            Show();
38 38
         }
39 39
 
40 40
         private System.Timers.Timer _timer;
@@ -56,9 +56,24 @@ namespace XHWK.WKTool
56 56
             _timer.Enabled = true;
57 57
             _timer.Interval = 1.0 * changeTime / 22;
58 58
             _timer.Elapsed += Timer_Elapsed;
59
+            _timer.Disposed += _timer_Disposed;
59 60
             _timer.Start();
60 61
             await Task.Delay(300);
61
-            imgLoding.Opacity = 1;
62
+        }
63
+
64
+        private void _timer_Disposed(object sender, EventArgs e)
65
+        {
66
+            Dispatcher.Invoke
67
+            (
68
+                async () =>
69
+                {
70
+                    // 执行操作
71
+                    imgLoding.Source = null;
72
+                    await Task.Delay(300);
73
+                    Hide();
74
+                },
75
+                DispatcherPriority.Send
76
+            );
62 77
         }
63 78
 
64 79
         private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
@@ -79,16 +94,7 @@ namespace XHWK.WKTool
79 94
             else
80 95
             {
81 96
                 _timer.Stop();
82
-                Dispatcher.Invoke
83
-                (
84
-                    () =>
85
-                    {
86
-                        // 执行操作
87
-                        imgLoding.Source = _images.Last();
88
-                        Hide();
89
-                    },
90
-                    DispatcherPriority.Send
91
-                );
97
+                _timer.Dispose();
92 98
             }
93 99
         }
94 100
 

+ 1
- 6
XHWK.WKTool/MainWindow.xaml.cs 查看文件

@@ -2613,13 +2613,8 @@ namespace XHWK.WKTool
2613 2613
                 if (App.W_CountdownWindow == null)
2614 2614
                 {
2615 2615
                     App.W_CountdownWindow = new CountdownWindow();
2616
-                    App.W_CountdownWindow.Initialize();
2617 2616
                 }
2618
-                else
2619
-                {
2620
-                    App.W_CountdownWindow.Initialize();
2621
-                }
2622
-                App.W_CountdownWindow.Show();
2617
+                App.W_CountdownWindow.InitAndShow();
2623 2618
 
2624 2619
                 #endregion 录像倒计时
2625 2620
 

+ 48
- 28
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs 查看文件

@@ -143,7 +143,6 @@ namespace XHWK.WKTool
143 143
                 //开始,暂停
144 144
                 BtnRecordingScreen_Click(null, null);
145 145
             }
146
-
147 146
             if (e.KeyValue == (int)Keys.F6 && (int)Control.ModifierKeys == (int)Keys.Control)
148 147
             {
149 148
                 //结束
@@ -273,7 +272,6 @@ namespace XHWK.WKTool
273 272
                         1000
274 273
                     );
275 274
                 }
276
-
277 275
                 _state = State.Loading;
278 276
                 _videoInfo = new Model_Video
279 277
                 {
@@ -284,13 +282,8 @@ namespace XHWK.WKTool
284 282
                 if (App.W_CountdownWindow == null)
285 283
                 {
286 284
                     App.W_CountdownWindow = new CountdownWindow();
287
-                    App.W_CountdownWindow.Initialize(true);
288
-                }
289
-                else
290
-                {
291
-                    App.W_CountdownWindow.Initialize(true);
292 285
                 }
293
-                App.W_CountdownWindow.Show();
286
+                App.W_CountdownWindow.InitAndShow(true);
294 287
                 BtnRecordingScreen.Visibility = Visibility.Collapsed;
295 288
                 BtnRecordingScreenPause.Visibility = Visibility.Visible;
296 289
                 BtnStopRecordingScreen.IsEnabled = true; //停止录制按钮可点击
@@ -574,25 +567,28 @@ namespace XHWK.WKTool
574 567
                 GetTimeStamp();
575 568
                 try
576 569
                 {
577
-                    Dispatcher.Invoke(() =>
578
-                    {
579
-                        if (App.W_PracticeWindow == null)
570
+                    Dispatcher.Invoke
571
+                    (
572
+                        () =>
580 573
                         {
581
-                            App.W_PracticeWindow = new PracticeWindow
574
+                            if (App.W_PracticeWindow == null)
582 575
                             {
583
-                                Width = pwidth,
584
-                                Height = pHeight,
585
-                                Left = 0,
586
-                                Top = 0
587
-                            };
576
+                                App.W_PracticeWindow = new PracticeWindow
577
+                                {
578
+                                    Width = pwidth,
579
+                                    Height = pHeight,
580
+                                    Left = 0,
581
+                                    Top = 0
582
+                                };
583
+                            }
584
+                            App.W_PracticeWindow.Initialize(); // imagePath);
585
+                            flg = 11;
586
+                            App.W_PracticeWindow.Blue();
587
+                            App.W_PracticeWindow.Show();
588
+                            App.W_PracticeWindow.Topmost = true;
589
+                            App.W_PracticeWindow.Focus();
588 590
                         }
589
-                        App.W_PracticeWindow.Initialize(); // imagePath);
590
-                        flg = 11;
591
-                        App.W_PracticeWindow.Blue();
592
-                        App.W_PracticeWindow.Show();
593
-                        App.W_PracticeWindow.Topmost = true;
594
-                        App.W_PracticeWindow.Focus();
595
-                    });
591
+                    );
596 592
                     new Thread
597 593
                     (
598 594
                         () =>
@@ -740,7 +736,17 @@ namespace XHWK.WKTool
740 736
         /// <returns></returns>
741 737
         public string GetTimeStamp()
742 738
         {
743
-            TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
739
+            TimeSpan ts = DateTime.Now
740
+            - new DateTime
741
+            (
742
+                1970,
743
+                1,
744
+                1,
745
+                0,
746
+                0,
747
+                0,
748
+                0
749
+            );
744 750
             return Convert.ToInt64(ts.TotalMilliseconds).ToString();
745 751
         }
746 752
 
@@ -800,7 +806,17 @@ namespace XHWK.WKTool
800 806
             #region 录屏批注取消画笔
801 807
 
802 808
             string imagePath = Path.Combine(_temppath, time + ".jpg");
803
-            ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), imagePath);
809
+            ImageHelper.GetScreenshot
810
+            (
811
+                new Rectangle
812
+                (
813
+                    0,
814
+                    0,
815
+                    0,
816
+                    0
817
+                ),
818
+                imagePath
819
+            );
804 820
 
805 821
             #endregion 录屏批注取消画笔
806 822
 
@@ -865,12 +881,16 @@ namespace XHWK.WKTool
865 881
         {
866 882
             if (_state == State.Pause || _state == State.Start)
867 883
             {
868
-                MessageBoxResult br = MessageWindow.Show("退出将结束并保存录制,是否继续?", "提示", MessageBoxButton.OKCancel);
884
+                MessageBoxResult br = MessageWindow.Show
885
+                (
886
+                    "退出将结束并保存录制,是否继续?",
887
+                    "提示",
888
+                    MessageBoxButton.OKCancel
889
+                );
869 890
                 if (br == MessageBoxResult.Cancel)
870 891
                 {
871 892
                     return;
872 893
                 }
873
-
874 894
                 BtnStopRecordingScreen_Click(null, null);
875 895
             }
876 896
             App.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();

+ 1
- 1
星火微课/星火微课-测试.iss 查看文件

@@ -3,7 +3,7 @@
3 3
 
4 4
 #define MyAppName "星火微课测试版"  
5 5
 #define MyAppDir "xhwk_test"
6
-#define MyAppVersion "3.9.2"
6
+#define MyAppVersion "3.9.3"
7 7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
8 8
 #define MyAppURL "http://www.xhkjedu.com/"
9 9
 #define MySourcePath "D:\Project\CSharp\xh-wkclient\XHWK.WKTool\bin\x86\Debug\"

Loading…
取消
儲存