Browse Source

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

录屏结束后未合并完成直接录制问题解决
倒计时优化
master
张剑 1 year ago
parent
commit
0ad60ca573

+ 2
- 2
XHWK.WKTool/App.config View File

9
     <!--参数是否加密 0不加密 1加密-->
9
     <!--参数是否加密 0不加密 1加密-->
10
     <add key="IsParameterEncryption" value="0" />
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
     <!--皮肤样式 0白 1蓝 2黑色 -->
14
     <!--皮肤样式 0白 1蓝 2黑色 -->
15
     <add key="SkinStyle" value="0" />
15
     <add key="SkinStyle" value="0" />
16
     <!--是否输出视频记录日志:0否-->
16
     <!--是否输出视频记录日志:0否-->

+ 19
- 13
XHWK.WKTool/CountdownWindow.xaml.cs View File

30
         /// </summary>
30
         /// </summary>
31
         private int _imgNum = 22;
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
             imgLoding.Source = _images.Last();
35
             imgLoding.Source = _images.Last();
37
             Init(showlblShortcut, changeTime);
36
             Init(showlblShortcut, changeTime);
37
+            Show();
38
         }
38
         }
39
 
39
 
40
         private System.Timers.Timer _timer;
40
         private System.Timers.Timer _timer;
56
             _timer.Enabled = true;
56
             _timer.Enabled = true;
57
             _timer.Interval = 1.0 * changeTime / 22;
57
             _timer.Interval = 1.0 * changeTime / 22;
58
             _timer.Elapsed += Timer_Elapsed;
58
             _timer.Elapsed += Timer_Elapsed;
59
+            _timer.Disposed += _timer_Disposed;
59
             _timer.Start();
60
             _timer.Start();
60
             await Task.Delay(300);
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
         private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
79
         private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
79
             else
94
             else
80
             {
95
             {
81
                 _timer.Stop();
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 View File

2613
                 if (App.W_CountdownWindow == null)
2613
                 if (App.W_CountdownWindow == null)
2614
                 {
2614
                 {
2615
                     App.W_CountdownWindow = new CountdownWindow();
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
                 #endregion 录像倒计时
2619
                 #endregion 录像倒计时
2625
 
2620
 

+ 48
- 28
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs View File

143
                 //开始,暂停
143
                 //开始,暂停
144
                 BtnRecordingScreen_Click(null, null);
144
                 BtnRecordingScreen_Click(null, null);
145
             }
145
             }
146
-
147
             if (e.KeyValue == (int)Keys.F6 && (int)Control.ModifierKeys == (int)Keys.Control)
146
             if (e.KeyValue == (int)Keys.F6 && (int)Control.ModifierKeys == (int)Keys.Control)
148
             {
147
             {
149
                 //结束
148
                 //结束
273
                         1000
272
                         1000
274
                     );
273
                     );
275
                 }
274
                 }
276
-
277
                 _state = State.Loading;
275
                 _state = State.Loading;
278
                 _videoInfo = new Model_Video
276
                 _videoInfo = new Model_Video
279
                 {
277
                 {
284
                 if (App.W_CountdownWindow == null)
282
                 if (App.W_CountdownWindow == null)
285
                 {
283
                 {
286
                     App.W_CountdownWindow = new CountdownWindow();
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
                 BtnRecordingScreen.Visibility = Visibility.Collapsed;
287
                 BtnRecordingScreen.Visibility = Visibility.Collapsed;
295
                 BtnRecordingScreenPause.Visibility = Visibility.Visible;
288
                 BtnRecordingScreenPause.Visibility = Visibility.Visible;
296
                 BtnStopRecordingScreen.IsEnabled = true; //停止录制按钮可点击
289
                 BtnStopRecordingScreen.IsEnabled = true; //停止录制按钮可点击
574
                 GetTimeStamp();
567
                 GetTimeStamp();
575
                 try
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
                     new Thread
592
                     new Thread
597
                     (
593
                     (
598
                         () =>
594
                         () =>
740
         /// <returns></returns>
736
         /// <returns></returns>
741
         public string GetTimeStamp()
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
             return Convert.ToInt64(ts.TotalMilliseconds).ToString();
750
             return Convert.ToInt64(ts.TotalMilliseconds).ToString();
745
         }
751
         }
746
 
752
 
800
             #region 录屏批注取消画笔
806
             #region 录屏批注取消画笔
801
 
807
 
802
             string imagePath = Path.Combine(_temppath, time + ".jpg");
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
             #endregion 录屏批注取消画笔
821
             #endregion 录屏批注取消画笔
806
 
822
 
865
         {
881
         {
866
             if (_state == State.Pause || _state == State.Start)
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
                 if (br == MessageBoxResult.Cancel)
890
                 if (br == MessageBoxResult.Cancel)
870
                 {
891
                 {
871
                     return;
892
                     return;
872
                 }
893
                 }
873
-
874
                 BtnStopRecordingScreen_Click(null, null);
894
                 BtnStopRecordingScreen_Click(null, null);
875
             }
895
             }
876
             App.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
896
             App.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();

+ 1
- 1
星火微课/星火微课-测试.iss View File

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

Loading…
Cancel
Save