Browse Source

星火微课 2.6.2

录制和录屏重写不再依赖第三方
打印重写
tags/3.0.0
张剑 3 years ago
parent
commit
62181adfae

+ 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="81" />
13
-    <add key="VersionName" value="2.6.1" />
12
+    <add key="VersionCode" value="82" />
13
+    <add key="VersionName" value="2.6.2" />
14
     <!--皮肤样式 0白 1蓝 2黑色 -->
14
     <!--皮肤样式 0白 1蓝 2黑色 -->
15
     <add key="SkinStyle" value="0" />
15
     <add key="SkinStyle" value="0" />
16
     <!--是否输出视频记录日志:0否-->
16
     <!--是否输出视频记录日志:0否-->

+ 0
- 34
XHWK.WKTool/App.cs View File

348
 
348
 
349
                 WindowsIdentity identity = WindowsIdentity.GetCurrent();
349
                 WindowsIdentity identity = WindowsIdentity.GetCurrent();
350
                 WindowsPrincipal principal = new WindowsPrincipal(identity);
350
                 WindowsPrincipal principal = new WindowsPrincipal(identity);
351
-                //判断当前登录用户是否为管理员
352
-                //if (principal.IsInRole(WindowsBuiltInRole.Administrator))
353
-                //{
354
-                //    //如果是管理员,则直接运行
355
-                //    W_CreateAMicroLessonWindow = new CreateAMicroLessonWindow();
356
-                //    // 定义Application对象作为整个应用程序入口
357
-                //    Application app = new Application();
358
-                //    app.Run(W_CreateAMicroLessonWindow);
359
-                //    //Application.Run(W_CreateAMicroLessonWindow);
360
-                //}
361
-                //else
362
-                //{
363
-                //    //创建启动对象
364
-                //    System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo
365
-                //    {
366
-                //        UseShellExecute = true,
367
-                //        WorkingDirectory = Environment.CurrentDirectory,
368
-                //        FileName = Assembly.GetExecutingAssembly().Location,
369
-                //        //设置启动动作,确保以管理员身份运行
370
-                //        Verb = "runas"
371
-                //    };
372
-                //    try
373
-                //    {
374
-                //        System.Diagnostics.Process.Start(startInfo);
375
-                //    }
376
-                //    catch
377
-                //    {
378
-                //        return;
379
-                //    }
380
-                //    //退出
381
-                //    //Current.Shutdown();
382
-                //    Environment.Exit(0);
383
-
384
-                //}
385
 
351
 
386
                 #endregion 强制以管理员方式运行 修改人:赵耀 修改时间:2020年9月7日
352
                 #endregion 强制以管理员方式运行 修改人:赵耀 修改时间:2020年9月7日
387
 
353
 

+ 5
- 5
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs View File

28
             InitializeComponent();
28
             InitializeComponent();
29
             ResizeMode = ResizeMode.NoResize;
29
             ResizeMode = ResizeMode.NoResize;
30
        
30
        
31
-            if (!APP.CheckScreenCapturerRecorder())
32
-            {
33
-                MessageWindow.Show("首次运行需安装环境,请在确定后依次点击“English-OK-Next>-Next>Install”完成安装!");
34
-                //APP.InstallScreenCapturerRecorder();
35
-            }
31
+            //if (!APP.CheckScreenCapturerRecorder())
32
+            //{
33
+            //    MessageWindow.Show("首次运行需安装环境,请在确定后依次点击“English-OK-Next>-Next>Install”完成安装!");
34
+            //    //APP.InstallScreenCapturerRecorder();
35
+            //}
36
             txbStoragePath.Text = FileToolsCommon.GetConfigValue("VideoSavePath");
36
             txbStoragePath.Text = FileToolsCommon.GetConfigValue("VideoSavePath");
37
             //APP.FFmpeg.GetMToFFmpeg();
37
             //APP.FFmpeg.GetMToFFmpeg();
38
 
38
 

BIN
XHWK.WKTool/Extension/ffmpeg.exe View File


+ 0
- 20
XHWK.WKTool/LoginWindow.xaml.cs View File

37
 
37
 
38
             #endregion 获取服务接口地址 --2021年7月9日赵耀
38
             #endregion 获取服务接口地址 --2021年7月9日赵耀
39
 
39
 
40
-            //if (APP.SkinStyle == "1")
41
-            //{
42
-            //    GridTitle.Visibility = Visibility.Visible;
43
-            //    GridTitle_Black.Visibility = Visibility.Collapsed;
44
-            //}
45
-            //else if (APP.SkinStyle == "2")
46
-            //{
47
-            //    GridTitle.Visibility = Visibility.Collapsed;
48
-            //    GridTitle_Black.Visibility = Visibility.Visible;
49
-            //}
50
-            //else
51
-            //{
52
-            //    GridTitle.Visibility = Visibility.Visible;
53
-            //    GridTitle_Black.Visibility = Visibility.Collapsed;
54
-            //}
55
             Initialize();
40
             Initialize();
56
         }
41
         }
57
 
42
 
67
                 }
52
                 }
68
             }
53
             }
69
             DataContext = APP.PageContextData;
54
             DataContext = APP.PageContextData;
70
-            //if (GetSettingString("isRemind").Equals("True"))
71
-            //{
72
-            //    ckSaveName.IsChecked = true;
73
-            //    txbAccountNumber.Text = GetSettingString("userName");
74
-            //}
75
         }
55
         }
76
 
56
 
77
         /// <summary>
57
         /// <summary>

+ 259
- 465
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs View File

1
 using Common.system;
1
 using Common.system;
2
 
2
 
3
+using NAudio.Wave;
4
+
5
+using NReco.VideoConverter;
6
+
3
 using System;
7
 using System;
4
 using System.Drawing;
8
 using System.Drawing;
5
 using System.IO;
9
 using System.IO;
7
 using System.Windows;
11
 using System.Windows;
8
 using System.Windows.Forms;
12
 using System.Windows.Forms;
9
 using System.Windows.Ink;
13
 using System.Windows.Ink;
14
+using System.Windows.Interop;
10
 using System.Windows.Media;
15
 using System.Windows.Media;
11
 using System.Windows.Media.Imaging;
16
 using System.Windows.Media.Imaging;
12
 using System.Windows.Threading;
17
 using System.Windows.Threading;
13
 
18
 
14
 using XHWK.Model;
19
 using XHWK.Model;
20
+using XHWK.WKTool.Utils;
15
 
21
 
16
 namespace XHWK.WKTool
22
 namespace XHWK.WKTool
17
 {
23
 {
28
         private string VideoSavePathName;
34
         private string VideoSavePathName;
29
 
35
 
30
         /// <summary>
36
         /// <summary>
31
-        /// 是否首次录屏
37
+        /// 临时视频路径
38
+        /// </summary>
39
+        private string TempVideoPathName;
40
+
41
+        /// <summary>
42
+        /// 临时麦克风路径
32
         /// </summary>
43
         /// </summary>
33
-        private bool IsFirstRS = true;
44
+        private string TempAudioPathName1;
34
 
45
 
35
         /// <summary>
46
         /// <summary>
36
-        /// 是否停止/暂停中
47
+        /// 临时扬声器路径
37
         /// </summary>
48
         /// </summary>
38
-        private bool IsSuspend = true;
49
+        private string TempAudioPathName2;
39
 
50
 
40
         /// <summary>
51
         /// <summary>
41
         /// 视频信息
52
         /// 视频信息
54
         {
65
         {
55
             Start,
66
             Start,
56
             Pause,
67
             Pause,
57
-            End
68
+            End,
69
+            Loading
58
         }
70
         }
59
 
71
 
60
         /// <summary>
72
         /// <summary>
69
         /// </summary>
81
         /// </summary>
70
         public int flg = 0;
82
         public int flg = 0;
71
 
83
 
72
-        private System.Timers.Timer timer = new System.Timers.Timer();
73
-
74
         #endregion 初始变量
84
         #endregion 初始变量
75
 
85
 
76
         #region 初始化
86
         #region 初始化
110
                 Thread.Sleep(100);
120
                 Thread.Sleep(100);
111
                 Dispatcher.Invoke(() =>
121
                 Dispatcher.Invoke(() =>
112
                 {
122
                 {
113
-                    //Owner = APP.W_PracticeWindow;
114
                     Topmost = true;
123
                     Topmost = true;
115
                 });
124
                 });
116
             }))).Start();
125
             }))).Start();
117
             APP.W_PracticeWindow.Hide();
126
             APP.W_PracticeWindow.Hide();
118
 
127
 
119
-            //borOne.Background = new SolidColorBrush(Colors.DodgerBlue);
120
-            //borTwo.Background = new SolidColorBrush(Colors.DodgerBlue);
121
             flg = 0;
128
             flg = 0;
122
 
129
 
123
             k_hook = new KeyboardHookCommon();
130
             k_hook = new KeyboardHookCommon();
130
             blackboard_canvas.DefaultDrawingAttributes = drawingAttributes;
137
             blackboard_canvas.DefaultDrawingAttributes = drawingAttributes;
131
             drawingAttributes.FitToCurve = true;
138
             drawingAttributes.FitToCurve = true;
132
             //隐藏画笔工具栏
139
             //隐藏画笔工具栏
133
-            //BtnToolbarDown_Click(null, null);
134
-            //GridSrToobar.Visibility = Visibility.Hidden;
135
-            //gridColour.Visibility = Visibility.Hidden;
136
-            //gridThickness.Visibility = Visibility.Hidden;
137
             BtnRecordingScreen.Visibility = Visibility.Visible;
140
             BtnRecordingScreen.Visibility = Visibility.Visible;
138
             BtnRecordingScreenPause.Visibility = Visibility.Collapsed;
141
             BtnRecordingScreenPause.Visibility = Visibility.Collapsed;
139
             BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
142
             BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
144
             BtnPenBlue_CL.Visibility = Visibility.Collapsed;
147
             BtnPenBlue_CL.Visibility = Visibility.Collapsed;
145
             BtnPenRed_CL.Visibility = Visibility.Collapsed;
148
             BtnPenRed_CL.Visibility = Visibility.Collapsed;
146
             TxbTime.Content = "00:00";
149
             TxbTime.Content = "00:00";
147
-            if (t == null)
148
-            {
149
-                t = new DispatcherTimer();
150
-                t.Tick += OnTimer;
151
-                t.Interval = new TimeSpan(0, 0, 0, 0, 200);
152
-                t.IsEnabled = true;
153
-                t.Start();
154
-            }
155
-            t.Interval = new TimeSpan(0, 0, 0, 0, 200);
156
-        }
157
-
158
-        private void TimerDealy(object o, EventArgs e)
159
-        {
160
-            Dispatcher.Invoke(() =>
161
-            {
162
-                if (Left > 1630)
163
-                {
164
-                    return;
165
-                }
166
-                //获取鼠标在屏幕上的位置
167
-                double mouse_x = Form.MousePosition.X;   //需要添加引用System.Drawing
168
-                double mouse_y = Form.MousePosition.Y;
169
-
170
-                bool is_in_collasped_range = (mouse_y > Left + Height) || (mouse_x < Left || mouse_x > Left + Width);//缩起的条件
171
-                bool is_in_visiable_range = (mouse_y < 1 && mouse_x >= Left && mouse_x <= Left + Width); //展开的条件
172
 
150
 
173
-                if (Left < 1630 && Left >= 0 && is_in_collasped_range)
174
-                {
175
-                    System.Threading.Thread.Sleep(300);
176
-                    Left += 20 /*-this.ActualWidth - 3*/;
177
-                }
178
-                else if (Left < 0 && is_in_visiable_range)
179
-                {
180
-                    Left = 1;
181
-                }
182
-            });
183
         }
151
         }
184
 
152
 
185
         private void K_hook_KeyDownEvent(object sender, System.Windows.Forms.KeyEventArgs e)
153
         private void K_hook_KeyDownEvent(object sender, System.Windows.Forms.KeyEventArgs e)
200
 
168
 
201
         #region 事件
169
         #region 事件
202
 
170
 
203
-        /// <summary>
204
-        /// 记录上次执行时间
205
-        /// </summary>
206
-        private DateTime Recorddt = DateTime.Now;
207
 
171
 
208
         private DateTime SRTime = Convert.ToDateTime("2020-01-01 00:00:00");
172
         private DateTime SRTime = Convert.ToDateTime("2020-01-01 00:00:00");
209
 
173
 
214
         /// <param name="e"></param>
178
         /// <param name="e"></param>
215
         private void OnTimer(object sender, EventArgs e)
179
         private void OnTimer(object sender, EventArgs e)
216
         {
180
         {
217
-            switch (_state)
181
+            if (_state == State.Start)
218
             {
182
             {
219
-                case State.Start:
220
-                    {
221
-                        DateTime dt = DateTime.Now;
222
-                        TimeSpan ts = dt.Subtract(Recorddt);//时间差
223
-                        double tsmi = ts.TotalMilliseconds;
224
-                        if (tsmi > 1000.0)
225
-                        {
226
-                            Recorddt = Recorddt.AddMilliseconds(1000);
227
-                            SRTime = SRTime.AddMilliseconds(1000);
228
-                        }
229
-                    }
230
-                    break;
231
-
232
-                case State.Pause:
233
-                    {
234
-                    }
235
-                    break;
236
-
237
-                case State.End:
238
-                    {
239
-                        SRTime = Convert.ToDateTime("2020-01-01 00:00:00");
240
-                        //_timeSpan = new TimeSpan();
241
-                        ////_timeSpan = new TimeSpan(0, 23, 12, 45, 54);
242
-                    }
243
-                    break;
183
+                SRTime = SRTime.AddMilliseconds(1000);
244
             }
184
             }
245
-
246
-            //string time = string.Format("{0:D2}:{1:D2}",/* _timeSpan.Hours,*/ _timeSpan.Minutes, _timeSpan.Seconds);
247
-            //char[] times = time.ToCharArray();
185
+             
248
             if (SRTime.Hour > 0)
186
             if (SRTime.Hour > 0)
249
             {
187
             {
250
-                //Dispatcher.Invoke(() =>
251
-                //{
252
                 TxbTime.Content = SRTime.ToString("HH:mm:ss");
188
                 TxbTime.Content = SRTime.ToString("HH:mm:ss");
253
-                //});
254
             }
189
             }
255
             else
190
             else
256
             {
191
             {
257
-                //Dispatcher.Invoke(() =>
258
-                //{
259
                 TxbTime.Content = SRTime.ToString("mm:ss");
192
                 TxbTime.Content = SRTime.ToString("mm:ss");
260
-                //});
261
             }
193
             }
262
         }
194
         }
263
 
195
 
264
-        /// <summary>
265
-        /// 开始
266
-        /// </summary>
267
-        /// <param name="sender"></param>
268
-        /// <param name="e"></param>
269
-        private void Stack()
270
-        {
271
-            Recorddt = DateTime.Now;
272
-            _state = State.Start;
273
-        }
274
-
275
-        /// <summary>
276
-        /// 暂停
277
-        /// </summary>
278
-        private void TimeOut()
279
-        {
280
-            _state = State.Pause;
281
-        }
282
-
283
         /// <summary>
196
         /// <summary>
284
         /// 结束
197
         /// 结束
285
         /// </summary>
198
         /// </summary>
297
         /// </summary>
210
         /// </summary>
298
         private void SetUpVideoPathName()
211
         private void SetUpVideoPathName()
299
         {
212
         {
300
-            //FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
213
+            string fileType = ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
301
             FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
214
             FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
302
             FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temprs/");
215
             FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temprs/");
303
-            VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
216
+            VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏." + fileType;
304
             int num = 1;
217
             int num = 1;
305
             while (FileToolsCommon.IsExistFile(VideoSavePathName))
218
             while (FileToolsCommon.IsExistFile(VideoSavePathName))
306
             {
219
             {
307
-                VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + "." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
308
                 num++;
220
                 num++;
221
+                VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + "." + fileType;
309
             }
222
             }
223
+
224
+
225
+            TempVideoPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + ".avi";
226
+            TempAudioPathName1 = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + "_1.mp3" ;
227
+            TempAudioPathName2 = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + "_2.mp3";
228
+
310
         }
229
         }
311
 
230
 
312
         /// <summary>
231
         /// <summary>
314
         /// </summary>
233
         /// </summary>
315
         private bool IsPressButton = false;
234
         private bool IsPressButton = false;
316
 
235
 
236
+        //录制麦克风的声音
237
+        ZAudioRecordHelper helper1 = null;
238
+
239
+        //录制扬声器的声音
240
+        ZAudioRecordHelper helper2 = null;
241
+
242
+        //桌面录制
243
+        ZVideoRecordHelper helper3 = null;
244
+
245
+        public IntPtr winHandle;// 当前窗体指针
246
+
317
         /// <summary>
247
         /// <summary>
318
         /// 开始或暂停录制
248
         /// 开始或暂停录制
319
         /// </summary>
249
         /// </summary>
339
 
269
 
340
             #endregion 防止连击
270
             #endregion 防止连击
341
 
271
 
342
-            if (IsSuspend)
272
+            if (_state == State.End)
343
             {
273
             {
344
-                if (IsFirstRS)
345
-                {
346
-                    #region 检测麦克风扬声器是否可用
274
+                SRTime = Convert.ToDateTime("2020-01-01 00:00:00");
275
+                TxbTime.Content = "00:00";
347
 
276
 
348
-                    string AudioPath = FileToolsCommon.GetFileAbsolutePath("/temp/audio/");
349
-                    FileToolsCommon.CreateDirectory(AudioPath);
350
-                    string audioSpeakerPath = AudioPath + "adoS" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".m";
351
-                    string audioMicrophonePath = AudioPath + "adoM" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".m";
352
-                    try
353
-                    {
354
-                        FileToolsCommon.DeleteFile(audioSpeakerPath);
355
-                        FileToolsCommon.DeleteFile(audioMicrophonePath);
356
-                    }
357
-                    catch (Exception)
358
-                    {
359
-                    }
360
-                    //扬声器
361
-                    if (APP.FFmpeg.StartRecordSpeakerAudio(audioSpeakerPath))
362
-                    {
363
-                        APP.FFmpeg.StopRecordAudio(2);
364
-                        //Thread.Sleep(500);
365
-                        //麦克风
366
-                        if (APP.FFmpeg.StartRecordAudio(audioMicrophonePath))
367
-                        {
368
-                        }
369
-                        else
370
-                        {
371
-                            //无法录制麦克风
372
-                            MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制麦克风,是否继续?", "消息提示", MessageBoxButton.OKCancel);
373
-                            if (Res == MessageBoxResult.Cancel)
374
-                            {
375
-                                return;
376
-                            }
377
-                        }
378
-                        APP.FFmpeg.StopRecordAudio(1);
379
-                    }
380
-                    else
381
-                    {
382
-                        //无法录制扬声器音频
383
-                        MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制音频,是否继续?", "消息提示", MessageBoxButton.OKCancel);
384
-                        if (Res == MessageBoxResult.Cancel)
385
-                        {
386
-                            return;
387
-                        }
388
-                    }
277
+                if (t == null)
278
+                {
279
+                    t = new DispatcherTimer();
280
+                    t.Tick += OnTimer;
281
+                    t.Interval = new TimeSpan(0, 0, 0, 0, 1000);
282
+                    t.IsEnabled = true;
283
+                    t.Start();
284
+                }
285
+                else {
286
+                    t.Interval = new TimeSpan(0, 0, 0, 0, 1000);
287
+                }
288
+             
289
+                _state = State.Loading;
290
+                #region 检测麦克风扬声器是否可用
291
+
292
+                //string AudioPath = FileToolsCommon.GetFileAbsolutePath("/temp/audio/");
293
+                //FileToolsCommon.CreateDirectory(AudioPath);
294
+                //string audioSpeakerPath = AudioPath + "adoS" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".m";
295
+                //string audioMicrophonePath = AudioPath + "adoM" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".m";
296
+                //try
297
+                //{
298
+                //    FileToolsCommon.DeleteFile(audioSpeakerPath);
299
+                //    FileToolsCommon.DeleteFile(audioMicrophonePath);
300
+                //}
301
+                //catch (Exception)
302
+                //{
303
+                //}
304
+                //扬声器
305
+                //if (APP.FFmpeg.StartRecordSpeakerAudio(audioSpeakerPath))
306
+                //{
307
+                //    APP.FFmpeg.StopRecordAudio(2);
308
+
309
+                //    //麦克风
310
+                //    if (APP.FFmpeg.StartRecordAudio(audioMicrophonePath))
311
+                //    {
312
+                //    }
313
+                //    else
314
+                //    {
315
+                //        //无法录制麦克风
316
+                //        MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制麦克风,是否继续?", "消息提示", MessageBoxButton.OKCancel);
317
+                //        if (Res == MessageBoxResult.Cancel)
318
+                //        {
319
+                //            return;
320
+                //        }
321
+                //    }
322
+                //    APP.FFmpeg.StopRecordAudio(1);
323
+                //}
324
+                //else
325
+                //{
326
+                //    //无法录制扬声器音频
327
+                //    MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制音频,是否继续?", "消息提示", MessageBoxButton.OKCancel);
328
+                //    if (Res == MessageBoxResult.Cancel)
329
+                //    {
330
+                //        return;
331
+                //    }
332
+                //}
389
 
333
 
390
-                    #endregion 检测麦克风扬声器是否可用
334
+                #endregion 检测麦克风扬声器是否可用
391
 
335
 
392
-                    VideoInfo = new Model_Video
393
-                    {
394
-                        VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType")),
395
-                        WkType = Enum_WKVidetype.RecordingScreen
396
-                    };
397
-                    SetUpVideoPathName();
398
-                    k_hook.Start();//安装键盘钩子
336
+                VideoInfo = new Model_Video
337
+                {
338
+                    VideoType = (Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType")),
339
+                    WkType = Enum_WKVidetype.RecordingScreen
340
+                };
341
+                SetUpVideoPathName();
342
+                k_hook.Start();//安装键盘钩子
399
 
343
 
400
-                    if (APP.W_CountdownWindow == null)
401
-                    {
402
-                        APP.W_CountdownWindow = new CountdownWindow();
403
-                        APP.W_CountdownWindow.Initialize(true, 1800);
404
-                        //APP.W_CountdownWindow.Topmost = true;
405
-                    }
406
-                    else
407
-                    {
408
-                        APP.W_CountdownWindow.Initialize(true, 1800);
409
-                        //APP.W_CountdownWindow.Topmost = true;
410
-                    }
411
-                    APP.W_CountdownWindow.Show();
412
-                }
413
-                IsSuspend = false;
344
+                //if (APP.W_CountdownWindow == null)
345
+                //{
346
+                //    APP.W_CountdownWindow = new CountdownWindow();
347
+                //    APP.W_CountdownWindow.Initialize(true, 1800);
348
+                //}
349
+                //else
350
+                //{
351
+                //    APP.W_CountdownWindow.Initialize(true, 1800);
352
+                //}
353
+                //APP.W_CountdownWindow.Show();
414
 
354
 
415
                 BtnRecordingScreen.Visibility = Visibility.Collapsed;
355
                 BtnRecordingScreen.Visibility = Visibility.Collapsed;
416
                 BtnRecordingScreenPause.Visibility = Visibility.Visible;
356
                 BtnRecordingScreenPause.Visibility = Visibility.Visible;
441
 
381
 
442
                 #endregion 隐藏工具栏
382
                 #endregion 隐藏工具栏
443
 
383
 
444
-                try
445
-                {
446
-                    #region 4秒内不可点击
384
+                helper1 = new ZAudioRecordHelper(TempAudioPathName1, ZAudioRecordHelper.RecordType.microphone);
385
+                helper2 = new ZAudioRecordHelper(TempAudioPathName2, ZAudioRecordHelper.RecordType.loudspeaker);
447
 
386
 
448
-                    new Thread(new ThreadStart(new Action(() =>
449
-                    {
450
-                        Dispatcher.Invoke(() =>
451
-                        {
452
-                            BtnRecordingScreen.IsEnabled = true;
453
-                            BtnStopRecordingScreen.IsEnabled = true;
454
-                            BtnRecordingScreenPause.IsEnabled = true;
455
-                        });
456
-                    }))).Start();
387
+                helper1.StartRecordAudio();
388
+                helper2.StartRecordAudio();
457
 
389
 
458
-                    #endregion 4秒内不可点击
459
-
460
-                    new Thread(new ThreadStart(new Action(() =>
461
-                    {
462
-                        if (IsFirstRS)
463
-                        {
464
-                            Thread.Sleep(800);
465
-                        }
466
-                        if (APP.FFmpeg.myProcess != null)
467
-                        {
468
-                            Thread.Sleep(100);
469
-                        }
470
-                        System.Drawing.Size DesktopSize = PrimaryScreen.DESKTOP;
471
-                        bool IsRecordingSound = FileToolsCommon.GetConfigValue("IsRecordingSound") == "1";
472
-                        bool IsRecordingMicrophone = FileToolsCommon.GetConfigValue("IsRecordingMicrophone") == "1";
473
-                        bool SynRes = APP.FFmpeg.StartRecordingVideo(VideoSavePathName, DesktopSize, IsRecordingSound, IsRecordingMicrophone, out string ErrMessage, APP.MicrophoneName);
390
+                winHandle = new WindowInteropHelper(this).Handle;
391
+                var curScreen = Screen.FromHandle(winHandle);
392
+                int RecordWidth = curScreen.Bounds.Width;
393
+                int RecordHeight = curScreen.Bounds.Height;
394
+                helper3 = new ZVideoRecordHelper(TempVideoPathName, RecordWidth, RecordHeight);
395
+                helper3.StartRecordVideo();
396
+                _state = State.Start;
474
 
397
 
475
-                        Thread.Sleep(1300);
476
-                        Dispatcher.Invoke(() =>
477
-                        {
478
-                            if (!SynRes)
479
-                            {
480
-                                MessageWindow.Show(ErrMessage);
481
-
482
-                                BtnRecordingScreen.Visibility = Visibility.Visible;
483
-                                BtnRecordingScreenPause.Visibility = Visibility.Collapsed;
484
-                                BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
485
-                                BtnPenBlue.IsEnabled = false;//蓝笔不可点击
486
-                                BtnPenRed.IsEnabled = false;//红笔不可点击
487
-                                BtnPenBlue.Visibility = Visibility.Visible;
488
-                                BtnPenRed.Visibility = Visibility.Visible;
489
-                                BtnPenBlue_CL.Visibility = Visibility.Collapsed;
490
-                                BtnPenRed_CL.Visibility = Visibility.Collapsed;
491
-                                IsSuspend = true;
492
-                                IsFirstRS = true;
493
-                                return;
494
-                            }
495
-                            Stack();
496
-                        });
497
-                    }))).Start();
498
-                }
499
-                catch (Exception ex)
500
-                {
501
-                    MessageWindow.Show(ex.Message);
502
-                }
503
-                IsFirstRS = false;
398
+                Console.WriteLine("TempAudioPathName1:"+ TempAudioPathName1);
399
+                Console.WriteLine("TempAudioPathName2:" + TempAudioPathName2);
400
+                Console.WriteLine("TempVideoPathName:" + TempVideoPathName);
504
             }
401
             }
505
-            else
402
+            else if (_state == State.Start)
506
             {
403
             {
507
-                TimeOut();
508
-                IsSuspend = true;
509
-                BtnRecordingScreen.Visibility = Visibility.Visible;
510
-                BtnRecordingScreenPause.Visibility = Visibility.Collapsed;
511
-                BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
512
-                //imgBlackPenOne.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
513
-                //btnBlackPenOne.IsEnabled = false;//蓝笔不可点击
514
-                //imgBlackPenTwo.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
515
-                //btnBlackPenTwo.IsEnabled = false;//红笔不可点击
516
-
517
-                #region 2秒内不可点击
518
-
519
-                new Thread(new ThreadStart(new Action(() =>
520
-                {
521
-                    //Dispatcher.Invoke(() =>
522
-                    //{
523
-                    //    ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar15.png"));
524
-                    //    BtnRecordingScreen.IsEnabled = false;
525
-                    //    BtnStopRecordingScreen.IsEnabled = false;
526
-                    //});
527
-                    //Thread.Sleep(2000);
528
-                    Dispatcher.Invoke(() =>
529
-                    {
530
-                        BtnRecordingScreen.IsEnabled = true;
531
-                        BtnStopRecordingScreen.IsEnabled = true;
532
-                    });
533
-                }))).Start();
534
-
535
-                #endregion 2秒内不可点击
536
-
537
-                try
538
-                {
539
-                    APP.FFmpeg.SuspendFFmpeg();
540
-                }
541
-                catch (Exception ex)
542
-                {
543
-                    MessageWindow.Show(ex.Message);
544
-                }
404
+                _state = State.Pause;
405
+                helper1.PauseRecordAudio();
406
+                helper2.PauseRecordAudio();
407
+                helper3.PauseRecordVideo();
408
+            }
409
+            else if (_state == State.Pause) {
410
+                _state = State.Start;
411
+                helper1.ResumeRecordAudio();
412
+                helper2.ResumeRecordAudio();
413
+                helper3.ResumeRecordVideo();
545
             }
414
             }
415
+
546
         }
416
         }
547
 
417
 
548
         /// <summary>
418
         /// <summary>
572
 
442
 
573
             BtnRecordingScreen.ToolTip = "开始";
443
             BtnRecordingScreen.ToolTip = "开始";
574
             k_hook.Stop();
444
             k_hook.Stop();
575
-            IsSuspend = true;
576
             TxbTime.Content = "00:00";
445
             TxbTime.Content = "00:00";
577
-            End();
446
+   
578
             if (APP.W_PracticeWindow != null)
447
             if (APP.W_PracticeWindow != null)
579
             {
448
             {
580
                 if (APP.W_PracticeWindow.Visibility == Visibility.Visible)
449
                 if (APP.W_PracticeWindow.Visibility == Visibility.Visible)
583
                     APP.W_PracticeWindow.ReturnPractice();
452
                     APP.W_PracticeWindow.ReturnPractice();
584
                 }
453
                 }
585
             }
454
             }
586
-            //if (gridToolbar.Visibility == Visibility.Visible)
587
-            //{
588
-            //    GridSrToobar.Visibility = Visibility.Visible;
589
-            //    gridToolbar.Visibility = Visibility.Hidden;
590
-            //    gridColour.Visibility = Visibility.Hidden;
591
-            //    gridThickness.Visibility = Visibility.Hidden;
592
-            //}
455
+
593
             if (APP.W_XHMicroLessonSystemWindow == null)
456
             if (APP.W_XHMicroLessonSystemWindow == null)
594
             {
457
             {
595
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
458
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
598
             APP.W_XHMicroLessonSystemWindow.InitPen();
461
             APP.W_XHMicroLessonSystemWindow.InitPen();
599
             APP.W_XHMicroLessonSystemWindow.InitTQLPPen();
462
             APP.W_XHMicroLessonSystemWindow.InitTQLPPen();
600
             APP.W_XHMicroLessonSystemWindow.Show();
463
             APP.W_XHMicroLessonSystemWindow.Show();
601
-            if (!IsFirstRS)
602
-            {
603
-                try
604
-                {
605
-                    if (SRTime.Hour > 0 || SRTime.Minute > 0 || SRTime.Second > 3)
464
+
465
+            if (_state == State.Pause || _state == State.Start) {
466
+                t.Stop();
467
+                t = null;
468
+                Console.WriteLine("停止录制");
469
+                helper1.StopRecordAudio();
470
+                helper2.StopRecordAudio();
471
+                helper3.StopRecordVideo();
472
+                FFMpegConverter ffMpeg = new FFMpegConverter();
473
+       
474
+                FFMpegInput[] input = new FFMpegInput[] {
475
+                    new FFMpegInput(TempVideoPathName),
476
+                    new FFMpegInput(TempAudioPathName1),
477
+                    new FFMpegInput(TempAudioPathName1),
478
+                };
479
+    
480
+                // 多路音频混音
481
+                ffMpeg.ConvertMedia(
482
+                    input,
483
+                    VideoSavePathName,
484
+                    "mp4",
485
+                    new OutputSettings()
606
                     {
486
                     {
607
-                        try
608
-                        {
609
-                            APP.FFmpeg.StopFFmpeg(VideoSavePathName);
610
-                        }
611
-                        catch (Exception ex)
612
-                        {
613
-                            LogHelper.WriteErrLog("【停止录屏】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
614
-                        }
615
-                        IsFirstRS = true;
616
-                        //生成缩略图
617
-                        string ThumbnailPath = FileToolsCommon.GetDirectoryName(VideoSavePathName) + "ThumbnailPath/";
618
-                        FileToolsCommon.CreateDirectory(ThumbnailPath);
619
-                        //缩略图存储位置
620
-                        string ThumbnailPathName = ThumbnailPath + FileToolsCommon.GetIOFileName(VideoSavePathName).Replace(".", "") + ".JPG";
621
-                        new Thread(new ThreadStart(new Action(() =>
622
-                        {
623
-                            while (!FileToolsCommon.IsExistFile(VideoSavePathName))
624
-                            {
625
-                                Thread.Sleep(100);
626
-                            }
627
-                            FileToolsCommon.DeleteFile(ThumbnailPathName);
628
-                            //VideoInfo.VideoSize = FileToolsCommon.GetFileSizeByMB(VideoSavePathName).ToString() + " MB";
629
-                            VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
630
-                            VideoInfo.VideoPath = VideoSavePathName;
631
-                            VideoInfo.ThumbnailPath = ThumbnailPathName;
632
-                            APP.FFmpeg.GenerateThumbnails(VideoSavePathName, ThumbnailPathName, 200, 130);
633
-                            VideoInfo.FileGuid = Guid.NewGuid().ToString();
634
-                            VideoInfo.IsUpload = false;
635
-                            VideoInfo.Uploaded = 0;
636
-                            //VideoInfo.Savefolder = APP.UserInfo.Schoolid + "/resource";
637
-                            if (!APP.VideoList.Exists(x => x.FileGuid == VideoInfo.FileGuid) || !APP.VideoList.Exists(x => x.VideoPath == VideoInfo.VideoPath))
638
-                            {
639
-                                APP.VideoList.Add(VideoInfo);
640
-                                //保存数据
641
-                                APP.SaveWkData();
642
-                            }
643
-                        }))).Start();
644
-                        Click_stopRecordingScreen();
487
+                        CustomOutputArgs = "-filter_complex amix=inputs=2:duration=first:dropout_transition=2"
645
                     }
488
                     }
646
-                    else
489
+                );
490
+                //生成缩略图
491
+                string ThumbnailPath = FileToolsCommon.GetDirectoryName(VideoSavePathName) + "ThumbnailPath/";
492
+                FileToolsCommon.CreateDirectory(ThumbnailPath);
493
+                //缩略图存储位置
494
+                string ThumbnailPathName = ThumbnailPath + FileToolsCommon.GetIOFileName(VideoSavePathName).Replace(".", "") + ".JPG";
495
+                new Thread(new ThreadStart(new Action(() =>
496
+                {
497
+
498
+                    FileToolsCommon.DeleteFile(ThumbnailPathName);
499
+                    VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
500
+                    VideoInfo.VideoPath = VideoSavePathName;
501
+                    VideoInfo.ThumbnailPath = ThumbnailPathName;
502
+                    APP.FFmpeg.GenerateThumbnails(VideoSavePathName, ThumbnailPathName, 200, 130);
503
+                    VideoInfo.FileGuid = Guid.NewGuid().ToString();
504
+                    VideoInfo.IsUpload = false;
505
+                    VideoInfo.Uploaded = 0;
506
+                    if (!APP.VideoList.Exists(x => x.FileGuid == VideoInfo.FileGuid) || !APP.VideoList.Exists(x => x.VideoPath == VideoInfo.VideoPath))
647
                     {
507
                     {
648
-                        //视频过短
649
-                        APP.FFmpeg.SuspendFFmpeg();
650
-                        IsFirstRS = true;
651
-                        MessageWindow.Show("录屏时间过短,请重新录制!");
508
+                        APP.VideoList.Add(VideoInfo);
509
+                        //保存数据
510
+                        APP.SaveWkData();
652
                     }
511
                     }
653
 
512
 
654
-                    new Thread(new ThreadStart(new Action(() =>
655
-                    {
656
-                        Thread.Sleep(700);
657
-                        Dispatcher.Invoke(() =>
658
-                        {
659
-                            if (APP.W_MinToolbar != null)
660
-                            {
661
-                                APP.W_MinToolbar.Hide();
662
-                            }
663
-                        });
664
-                    }))).Start();
665
-                }
666
-                catch (Exception ex)
667
-                {
668
-                    LogHelper.WriteErrLog("【停止录屏】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
669
-                }
513
+                    FileToolsCommon.DeleteFile(TempAudioPathName1);
514
+                    FileToolsCommon.DeleteFile(TempAudioPathName2);
515
+                    FileToolsCommon.DeleteFile(TempVideoPathName);
516
+                }))).Start();
517
+                Click_stopRecordingScreen();
670
             }
518
             }
671
             Hide();
519
             Hide();
520
+            End();
672
         }
521
         }
673
 
522
 
674
         public void MaxToobar()
523
         public void MaxToobar()
703
         /// </summary>
552
         /// </summary>
704
         public void PenPractice()
553
         public void PenPractice()
705
         {
554
         {
706
-            if (!IsFirstRS)
555
+            if (flg != 11 && flg != 10)
707
             {
556
             {
708
-                if (flg != 11 && flg != 10)
709
-                {
710
-                    #region 防止连击
557
+                #region 防止连击
711
 
558
 
712
-                    if (IsPressButton)
713
-                    {
714
-                        return;
715
-                    }
716
-                    else
559
+                if (IsPressButton)
560
+                {
561
+                    return;
562
+                }
563
+                else
564
+                {
565
+                    IsPressButton = true;
566
+                    new Thread(new ThreadStart(new Action(() =>
717
                     {
567
                     {
718
-                        IsPressButton = true;
719
-                        new Thread(new ThreadStart(new Action(() =>
720
-                        {
721
-                            Thread.Sleep(500);
722
-                            IsPressButton = false;
723
-                        }))).Start();
724
-                    }
568
+                        Thread.Sleep(500);
569
+                        IsPressButton = false;
570
+                    }))).Start();
571
+                }
725
 
572
 
726
-                    #endregion 防止连击
573
+                #endregion 防止连击
727
 
574
 
728
-                    string time = GetTimeStamp();
729
-                    string tempPath = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
730
-                    if (!Directory.Exists(tempPath))
575
+                string time = GetTimeStamp();
576
+                string tempPath = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
577
+                if (!Directory.Exists(tempPath))
578
+                {
579
+                    Directory.CreateDirectory(tempPath);
580
+                }
581
+                try
582
+                {
583
+                    Dispatcher.Invoke(() =>
731
                     {
584
                     {
732
-                        Directory.CreateDirectory(tempPath);
733
-                    }
734
-                    try
585
+                        //borOne.Background = new SolidColorBrush(Colors.LightSkyBlue);
586
+                        //borTwo.Background = new SolidColorBrush(Colors.DodgerBlue);
587
+                        if (APP.W_PracticeWindow == null)
588
+                        {
589
+                            APP.W_PracticeWindow = new PracticeWindow
590
+                            {
591
+                                Width = pwidth,
592
+                                Height = pHeight,
593
+                                Left = 0,
594
+                                Top = 0
595
+                            };
596
+                            //practiceWin.Owner = this;
597
+                        }
598
+                        //APP.W_PracticeWindow.InitPen();
599
+                        //APP.W_PracticeWindow.InitTQLPPen();
600
+                        APP.W_PracticeWindow.Initialize();// imagePath);
601
+                        flg = 11;
602
+                        APP.W_PracticeWindow.Blue();
603
+                        APP.W_PracticeWindow.Show();
604
+                        APP.W_PracticeWindow.Topmost = true;
605
+                        APP.W_PracticeWindow.Focus();
606
+                    });
607
+
608
+                    new Thread(new ThreadStart(new Action(() =>
735
                     {
609
                     {
736
                         Dispatcher.Invoke(() =>
610
                         Dispatcher.Invoke(() =>
737
                         {
611
                         {
738
-                            //borOne.Background = new SolidColorBrush(Colors.LightSkyBlue);
739
-                            //borTwo.Background = new SolidColorBrush(Colors.DodgerBlue);
740
-                            if (APP.W_PracticeWindow == null)
741
-                            {
742
-                                APP.W_PracticeWindow = new PracticeWindow
743
-                                {
744
-                                    Width = pwidth,
745
-                                    Height = pHeight,
746
-                                    Left = 0,
747
-                                    Top = 0
748
-                                };
749
-                                //practiceWin.Owner = this;
750
-                            }
751
-                            //APP.W_PracticeWindow.InitPen();
752
-                            //APP.W_PracticeWindow.InitTQLPPen();
753
-                            APP.W_PracticeWindow.Initialize();// imagePath);
754
-                            flg = 11;
755
-                            APP.W_PracticeWindow.Blue();
756
-                            APP.W_PracticeWindow.Show();
757
-                            APP.W_PracticeWindow.Topmost = true;
758
-                            APP.W_PracticeWindow.Focus();
612
+                            APP.W_PracticeWindow.Topmost = false;
759
                         });
613
                         });
760
-
761
-                        new Thread(new ThreadStart(new Action(() =>
614
+                        Thread.Sleep(500);
615
+                        Dispatcher.Invoke(() =>
762
                         {
616
                         {
763
-                            Dispatcher.Invoke(() =>
764
-                            {
765
-                                APP.W_PracticeWindow.Topmost = false;
766
-                            });
767
-                            Thread.Sleep(500);
768
-                            Dispatcher.Invoke(() =>
769
-                            {
770
-                                //Owner = APP.W_PracticeWindow;
771
-                                Topmost = true;
772
-                            });
773
-                        }))).Start();
774
-                    }
775
-                    catch (Exception ex)
776
-                    {
777
-                        LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
778
-                    }
617
+                            //Owner = APP.W_PracticeWindow;
618
+                            Topmost = true;
619
+                        });
620
+                    }))).Start();
621
+                }
622
+                catch (Exception ex)
623
+                {
624
+                    LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
779
                 }
625
                 }
780
             }
626
             }
781
         }
627
         }
1109
         /// </summary>
955
         /// </summary>
1110
         public event StopRecordingScreen Click_stopRecordingScreen;
956
         public event StopRecordingScreen Click_stopRecordingScreen;
1111
 
957
 
1112
-        /// <summary>
1113
-        /// 黑笔
1114
-        /// </summary>
1115
-        /// <param name="sender"></param>
1116
-        /// <param name="e"></param>
1117
-        private void BtnBlackPen_Click(object sender, RoutedEventArgs e)
1118
-        {
1119
-        }
958
+
1120
 
959
 
1121
         /// <summary>
960
         /// <summary>
1122
         /// 移动工具栏
961
         /// 移动工具栏
1180
             {
1019
             {
1181
                 if (flg == 10)
1020
                 if (flg == 10)
1182
                 {
1021
                 {
1183
-                    //Dispatcher.Invoke(() =>
1184
-                    //{
1185
-                    //    borOne.Background = new SolidColorBrush(Colors.DodgerBlue);
1186
-                    //    borTwo.Background = new SolidColorBrush(Colors.DodgerBlue);
1187
-                    //});
1188
                     flg = 0;
1022
                     flg = 0;
1189
-                    //this.Owner = null;
1190
                     APP.W_PracticeWindow.ReturnPractice();
1023
                     APP.W_PracticeWindow.ReturnPractice();
1191
                 }
1024
                 }
1192
                 else if (flg == 11)
1025
                 else if (flg == 11)
1193
                 {
1026
                 {
1194
-                    //Dispatcher.Invoke(() =>
1195
-                    //{
1196
-                    //    borTwo.Background = new SolidColorBrush(Colors.LightSkyBlue);
1197
-                    //    borOne.Background = new SolidColorBrush(Colors.DodgerBlue);
1198
-                    //});
1199
                     flg = 10;
1027
                     flg = 10;
1200
                     APP.W_PracticeWindow.Red();
1028
                     APP.W_PracticeWindow.Red();
1201
                 }
1029
                 }
1202
                 else
1030
                 else
1203
                 {
1031
                 {
1204
-                    //Dispatcher.Invoke(() =>
1205
-                    //{
1206
-                    //    borTwo.Background = new SolidColorBrush(Colors.LightSkyBlue);
1207
-                    //    borOne.Background = new SolidColorBrush(Colors.DodgerBlue);
1208
-                    //});
1209
                     if (APP.W_PracticeWindow == null)
1032
                     if (APP.W_PracticeWindow == null)
1210
                     {
1033
                     {
1211
                         APP.W_PracticeWindow = new PracticeWindow
1034
                         APP.W_PracticeWindow = new PracticeWindow
1212
                         {
1035
                         {
1213
-                            //APP.W_PracticeWindow.Topmost = true;
1214
                             Width = pwidth,
1036
                             Width = pwidth,
1215
                             Height = pHeight,
1037
                             Height = pHeight,
1216
                             Left = 0,
1038
                             Left = 0,
1217
                             Top = 0
1039
                             Top = 0
1218
                         };
1040
                         };
1219
-                        //practiceWin.Owner = this;
1220
                     }
1041
                     }
1221
                     APP.W_PracticeWindow.InitPen();
1042
                     APP.W_PracticeWindow.InitPen();
1222
                     APP.W_PracticeWindow.InitTQLPPen();
1043
                     APP.W_PracticeWindow.InitTQLPPen();
1249
         /// <param name="e"></param>
1070
         /// <param name="e"></param>
1250
         private void BtnReturn_Click(object sender, RoutedEventArgs e)
1071
         private void BtnReturn_Click(object sender, RoutedEventArgs e)
1251
         {
1072
         {
1252
-            if (!IsFirstRS)
1073
+            if (_state==State.Pause || _state == State.Start)
1253
             {
1074
             {
1254
                 MessageBoxResult br = MessageWindow.Show("退出将取消保存当前录屏,是否继续?", "提示", MessageBoxButton.OKCancel);
1075
                 MessageBoxResult br = MessageWindow.Show("退出将取消保存当前录屏,是否继续?", "提示", MessageBoxButton.OKCancel);
1255
                 if (br == MessageBoxResult.Cancel)
1076
                 if (br == MessageBoxResult.Cancel)
1258
                 }
1079
                 }
1259
                 k_hook.Stop();
1080
                 k_hook.Stop();
1260
                 BtnRecordingScreen.ToolTip = "开始";
1081
                 BtnRecordingScreen.ToolTip = "开始";
1261
-                IsSuspend = true;
1082
+
1262
                 TxbTime.Content = "00:00";
1083
                 TxbTime.Content = "00:00";
1263
                 End();
1084
                 End();
1264
                 APP.W_PracticeWindow.ReturnPractice();
1085
                 APP.W_PracticeWindow.ReturnPractice();
1289
                     {
1110
                     {
1290
                         LogHelper.WriteErrLog("【录屏返回】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
1111
                         LogHelper.WriteErrLog("【录屏返回】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
1291
                     }
1112
                     }
1292
-                    IsFirstRS = true;
1113
+         
1293
                     new Thread(new ThreadStart(new Action(() =>
1114
                     new Thread(new ThreadStart(new Action(() =>
1294
                     {
1115
                     {
1295
                         VideoInfo = null;
1116
                         VideoInfo = null;
1320
             Hide();
1141
             Hide();
1321
         }
1142
         }
1322
 
1143
 
1323
-        /// <summary>
1324
-        /// 批注退出 废弃
1325
-        /// </summary>
1326
-        public void ReturnPractice()
1327
-        {
1328
-            new Thread(new ThreadStart(new Action(() =>
1329
-            {
1330
-                flg = 0;
1331
-                Thread.Sleep(500);
1332
-                Dispatcher.Invoke(() =>
1333
-                {
1334
-                    Owner = null;
1335
-                    APP.W_PracticeWindow.Hide();
1336
-                });
1337
-            }))).Start();
1338
-        }
1339
-
1340
         /// <summary>
1144
         /// <summary>
1341
         /// 修改笔状态
1145
         /// 修改笔状态
1342
         /// </summary>
1146
         /// </summary>
1361
                     }
1165
                     }
1362
                     APP.W_MinToolbar.Topmost = true;
1166
                     APP.W_MinToolbar.Topmost = true;
1363
                     double MinToolTop = Top;
1167
                     double MinToolTop = Top;
1364
-                    //int ColorType = 0;
1365
-                    //if (APP.SkinStyle == "1")
1366
-                    //{
1367
-                    //    ColorType = 0;
1368
-                    //    MinToolTop = this.Top + ((this.ActualHeight - btnReturn.ActualHeight) / 2);
1369
-                    //}
1370
-                    //else if (APP.SkinStyle == "2")
1371
-                    //{
1372
-                    //    ColorType = 1;
1373
-                    //    MinToolTop = this.Top + ((this.ActualHeight - VbxBlack.ActualHeight) / 2);
1374
-                    //}
1168
+
1375
                     new Thread(new ThreadStart(new Action(() =>
1169
                     new Thread(new ThreadStart(new Action(() =>
1376
                     {
1170
                     {
1377
                         Thread.Sleep(500);
1171
                         Thread.Sleep(500);

+ 75
- 0
XHWK.WKTool/Utils/ZAsposeUtil.cs View File

1
+using Aspose.Words.Saving;
2
+
3
+using Common.system;
4
+
5
+using System;
6
+using System.Collections.Generic;
7
+using System.IO;
8
+
9
+namespace XHWK.WKTool.Utils
10
+{
11
+    class ZAsposeUtil
12
+    {
13
+        /// <summary>
14
+        /// 将Word文档转换为图片的方法(该方法基于第三方DLL),
15
+        /// 你可以像这样调用该方法: ConvertPDF2Image("F:\\PdfFile.doc", "F:\\","ImageFile", 1, 20);
16
+        /// </summary>
17
+        /// <param name="pdfInputPath">Word文件路径</param>
18
+        /// <param name="imageOutputPath">图片输出路径,如果为空,默认值为Word所在路径</param>
19
+        /// <param name="imageName">图片的名字,不需要带扩展名,如果为空,默认值为Word的名称</param>
20
+        /// <param name="startPageNum">从PDF文档的第几页开始转换,如果为0,默认值为1</param>
21
+        /// <param name="endPageNum">从PDF文档的第几页开始停止转换,如果为0,默认值为Word总页数</param>
22
+        /// <param name="imageFormat">设置所需图片格式,如果为null,默认格式为PNG</param>
23
+        /// <param name="resolution">设置图片的像素,数字越大越清晰,如果为0,默认值为128,建议最大值不要超过1024</param>
24
+        public static List<string> ConvertWordToImage(
25
+            string wordInputPath,
26
+            string imageOutputPath,
27
+            string imageName,
28
+            int startPageNum = 0,
29
+            int endPageNum = 0,
30
+            Aspose.Words.SaveFormat imageFormat = Aspose.Words.SaveFormat.Png,
31
+            float resolution = 128
32
+            )
33
+        {
34
+            // 返回的图片绝对路径集合
35
+            List<string> images = new List<string>();
36
+            try
37
+            {
38
+                // open word file
39
+                Aspose.Words.Document doc = new Aspose.Words.Document(wordInputPath);
40
+
41
+                // validate parameter
42
+                if (doc == null) { throw new Exception("Word文件无效或者Word文件被加密!"); }
43
+                if (imageOutputPath.Trim().Length == 0) { imageOutputPath = System.IO.Path.GetDirectoryName(wordInputPath); }
44
+                if (!Directory.Exists(imageOutputPath)) { Directory.CreateDirectory(imageOutputPath); }
45
+                if (imageName.Trim().Length == 0) { imageName = System.IO.Path.GetFileNameWithoutExtension(wordInputPath); }
46
+                if (startPageNum <= 0) { startPageNum = 1; }
47
+                if (endPageNum > doc.PageCount || endPageNum <= 0) { endPageNum = doc.PageCount; }
48
+                if (startPageNum > endPageNum) { int tempPageNum = startPageNum; startPageNum = endPageNum; endPageNum = startPageNum; }
49
+                if (resolution <= 0) { resolution = 128; }
50
+
51
+                ImageSaveOptions imageSaveOptions = new ImageSaveOptions(imageFormat)
52
+                {
53
+                    Resolution = resolution
54
+                };
55
+
56
+                // start to convert each page
57
+                for (int i = startPageNum; i <= endPageNum; i++)
58
+                {
59
+                    imageSaveOptions.PageIndex = i - 1;
60
+                    string savepath = System.IO.Path.Combine(imageOutputPath, imageName) + "_" + i + "." + imageFormat.ToString();
61
+                    doc.Save(savepath, imageSaveOptions);
62
+                    images.Add(savepath);
63
+                }
64
+                imageSaveOptions = null;
65
+                doc = null;
66
+            }
67
+            catch (Exception ex)
68
+            {
69
+                MessageWindow.Show("该文件无法使用!");
70
+                LogHelper.WriteErrLog("【导入方法(ConvertWordToImage)】错误日志:" + ex.Message, ex);
71
+            }
72
+            return images;
73
+        }
74
+    }
75
+}

+ 130
- 0
XHWK.WKTool/Utils/ZAudioRecordHelper.cs View File

1
+using System;
2
+
3
+using NAudio.Wave;
4
+
5
+namespace XHWK.WKTool.Utils
6
+{
7
+    public class ZAudioRecordHelper
8
+    {
9
+        public enum RecordType
10
+        {
11
+            loudspeaker = 0, // 扬声器
12
+            microphone = 1 //麦克风
13
+        }
14
+
15
+        public enum RecordState
16
+        {
17
+            stop = 0,
18
+            start = 1,
19
+            pause = 2
20
+        }
21
+
22
+        //录制的类型
23
+        RecordType _t = RecordType.microphone;
24
+
25
+        RecordState _state = RecordState.stop;
26
+
27
+        //录制麦克风的声音
28
+        WaveInEvent waveIn = null; //new WaveInEvent();
29
+                                   //录制扬声器的声音
30
+        WasapiLoopbackCapture capture = null; //new WasapiLoopbackCapture();
31
+                                              //生成音频文件的对象
32
+        WaveFileWriter writer = null;
33
+
34
+        string audioFile = "";
35
+
36
+        public ZAudioRecordHelper(string filePath,RecordType type)
37
+        {
38
+            _t = type;
39
+            audioFile = filePath;
40
+        }
41
+
42
+        /// <summary>
43
+        /// 开始录制
44
+        /// </summary>
45
+        public void StartRecordAudio()
46
+        {
47
+            _state = RecordState.start;
48
+            try
49
+            {
50
+                if (_t == RecordType.microphone)
51
+                {
52
+                    waveIn = new WaveInEvent();
53
+                    writer = new WaveFileWriter(audioFile, waveIn.WaveFormat);
54
+                    //开始录音,写数据
55
+                    waveIn.DataAvailable += (s, a) =>
56
+                    {
57
+                        if (_state == RecordState.start) {
58
+                            writer.Write(a.Buffer, 0, a.BytesRecorded);
59
+                        }
60
+                    };
61
+
62
+                    //结束录音
63
+                    waveIn.RecordingStopped += (s, a) =>
64
+                    {
65
+                        writer.Dispose();
66
+                        writer = null;
67
+                        waveIn.Dispose();
68
+                    };
69
+
70
+                    waveIn.StartRecording();
71
+                }
72
+                else
73
+                {
74
+                    capture = new WasapiLoopbackCapture();
75
+                    writer = new WaveFileWriter(audioFile, capture.WaveFormat);
76
+
77
+                    capture.DataAvailable += (s, a) =>
78
+                    {
79
+                        if (_state == RecordState.start)
80
+                        {
81
+                            writer.Write(a.Buffer, 0, a.BytesRecorded);
82
+                        }
83
+                    };
84
+                    //结束录音
85
+                    capture.RecordingStopped += (s, a) =>
86
+                    {
87
+                        writer.Dispose();
88
+                        writer = null;
89
+                        capture.Dispose();
90
+                    };
91
+                    capture.StartRecording();
92
+                } 
93
+            }
94
+            catch (Exception ex)
95
+            {
96
+            }
97
+        }
98
+
99
+        /// <summary>
100
+        /// 结束录制
101
+        /// </summary>
102
+        public void StopRecordAudio()
103
+        {
104
+            _state = RecordState.stop;
105
+            if (_t == RecordType.microphone)
106
+            {
107
+                waveIn.StopRecording();
108
+            }
109
+            else
110
+            {
111
+                capture.StopRecording();
112
+            }
113
+        }
114
+
115
+        /// <summary>
116
+        /// 暂停录制
117
+        /// </summary>
118
+        public void PauseRecordAudio()
119
+        {
120
+            _state = RecordState.pause;
121
+        }
122
+
123
+        /// <summary>
124
+        /// 恢复录制
125
+        /// </summary>
126
+        public void ResumeRecordAudio() {
127
+            _state = RecordState.start;
128
+        }
129
+    }
130
+}

XHWK.WKTool/Utils/PrintUtils.cs → XHWK.WKTool/Utils/ZPrintUtils.cs View File

1
-using System;
2
-using System.Collections.Generic;
1
+using System.Collections.Generic;
3
 using System.Drawing.Printing;
2
 using System.Drawing.Printing;
4
 using System.Runtime.InteropServices;
3
 using System.Runtime.InteropServices;
5
 
4
 
6
 namespace XHWK.WKTool.Utils
5
 namespace XHWK.WKTool.Utils
7
 {
6
 {
8
-    class PrintUtils
7
+    class ZPrintUtils
9
     {
8
     {
10
         private static PrintDocument fPrintDocument = new PrintDocument();
9
         private static PrintDocument fPrintDocument = new PrintDocument();
11
         /// <summary>
10
         /// <summary>
12
         /// 获取本机默认打印机名称
11
         /// 获取本机默认打印机名称
13
         /// </summary>
12
         /// </summary>
14
         /// <returns></returns>
13
         /// <returns></returns>
15
-        public static String DefaultPrinter()
14
+        public static string DefaultPrinter()
16
         {
15
         {
17
             return fPrintDocument.PrinterSettings.PrinterName;
16
             return fPrintDocument.PrinterSettings.PrinterName;
18
         }
17
         }

+ 157
- 0
XHWK.WKTool/Utils/ZVideoRecordHelper.cs View File

1
+using System;
2
+using System.Runtime.InteropServices;
3
+
4
+using Accord.Video;
5
+using Accord.Video.FFMPEG;
6
+
7
+namespace XHWK.WKTool.Utils
8
+{
9
+    public class ZVideoRecordHelper
10
+    {
11
+
12
+        public enum RecordState
13
+        {
14
+            stop = 0,
15
+            start = 1,
16
+            pause = 2
17
+        }
18
+
19
+        RecordState _state = RecordState.stop;
20
+
21
+        string _filePath = "";
22
+        int _width = 0;
23
+        int _height = 0;
24
+        //录制帧率
25
+        int _rate = 5;
26
+        //录制质量
27
+        int _quality = 8;
28
+        bool _captureMouse = false;
29
+
30
+        private VideoFileWriter videoWriter = new VideoFileWriter();//视频写入
31
+        private ScreenCaptureStream videoStreamer;//视频捕获
32
+
33
+        public ZVideoRecordHelper(string filePath, int width,int height,int rate = 5,int quality=8, bool captureMouse = false)
34
+        {
35
+            _filePath = filePath;
36
+            _width = width / 2 * 2;
37
+            _height = height / 2 * 2;
38
+            _rate = rate;
39
+            _quality = quality;
40
+            _captureMouse = captureMouse;
41
+        }
42
+
43
+        /// <summary>
44
+        /// 开始录制
45
+        /// </summary>
46
+        public bool StartRecordVideo()
47
+        {
48
+            _state = RecordState.start;
49
+            try
50
+            {
51
+                // 打开写入
52
+                lock (this)
53
+                {
54
+                    videoWriter.Open(
55
+                        _filePath,
56
+                        _width,
57
+                        _height,
58
+                        _rate,
59
+                        VideoCodec.MPEG4,
60
+                        _width * _height * _quality
61
+                    );
62
+                }
63
+
64
+                System.Drawing.Rectangle rec = new System.Drawing.Rectangle(0,0,_width,_height);
65
+                videoStreamer = new ScreenCaptureStream(rec, 1000 / _rate);//帧间隔需要和帧率关联,不然录的10秒视频文件不是10s
66
+                videoStreamer.NewFrame += VideoNewFrame;
67
+                videoStreamer.Start();
68
+            }
69
+            catch (Exception ex)
70
+            {
71
+                return false;
72
+            }
73
+
74
+            return true;
75
+        }
76
+
77
+
78
+        [DllImport("user32.dll")]
79
+        private static extern bool GetCursorInfo(out CURSORINFO pci);
80
+
81
+        [StructLayout(LayoutKind.Sequential)]
82
+        private struct POINT
83
+        {
84
+            public Int32 x;
85
+            public Int32 y;
86
+        }
87
+
88
+        [StructLayout(LayoutKind.Sequential)]
89
+        private struct CURSORINFO
90
+        {
91
+            public Int32 cbSize;
92
+            public Int32 flags;
93
+            public IntPtr hCursor;
94
+            public POINT ptScreenPos;
95
+        }
96
+
97
+        // 帧返回时绘制上鼠标
98
+        private void VideoNewFrame(object sender, NewFrameEventArgs e)
99
+        {
100
+            if (_state == RecordState.start)
101
+            {
102
+                if (_captureMouse)
103
+                {
104
+                    var g = System.Drawing.Graphics.FromImage(e.Frame);
105
+                    CURSORINFO pci;
106
+                    pci.cbSize = Marshal.SizeOf(typeof(CURSORINFO));
107
+                    GetCursorInfo(out pci);
108
+                    try
109
+                    {
110
+                        System.Windows.Forms.Cursor cur = new System.Windows.Forms.Cursor(pci.hCursor);
111
+                        cur.Draw(
112
+                            g,
113
+                            new System.Drawing.Rectangle(
114
+                                System.Windows.Forms.Cursor.Position.X - 10,
115
+                                System.Windows.Forms.Cursor.Position.Y - 10,
116
+                                cur.Size.Width,
117
+                                cur.Size.Height
118
+                            )
119
+                        );
120
+                    }
121
+                    catch { }//打开任务管理器时会导致异常
122
+                }
123
+                videoWriter.WriteVideoFrame(e.Frame);
124
+            }
125
+        }
126
+
127
+        /// <summary>
128
+        /// 结束录制
129
+        /// </summary>
130
+        public void StopRecordVideo()
131
+        {
132
+            _state = RecordState.stop;
133
+            // 停止
134
+            videoStreamer.Stop();
135
+
136
+            //结束写入
137
+            videoWriter.Close();
138
+            videoWriter.Dispose();
139
+        }
140
+
141
+        /// <summary>
142
+        /// 暂停录制
143
+        /// </summary>
144
+        public void PauseRecordVideo()
145
+        {
146
+            _state = RecordState.pause;
147
+        }
148
+
149
+        /// <summary>
150
+        /// 恢复录制
151
+        /// </summary>
152
+        public void ResumeRecordVideo()
153
+        {
154
+            _state = RecordState.start;
155
+        }
156
+    }
157
+}

+ 94
- 263
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

1
 using Accord.Video.FFMPEG;
1
 using Accord.Video.FFMPEG;
2
 
2
 
3
 using Aspose.Slides;
3
 using Aspose.Slides;
4
-using Aspose.Words.Saving;
5
 
4
 
6
 using ComeCapture;
5
 using ComeCapture;
7
 
6
 
13
 
12
 
14
 using RobotpenGateway;
13
 using RobotpenGateway;
15
 
14
 
16
-using Spire.Pdf;
17
-using Spire.Pdf.Print;
18
-
19
 using System;
15
 using System;
20
 using System.Collections.Generic;
16
 using System.Collections.Generic;
21
 using System.Data;
17
 using System.Data;
22
 using System.Diagnostics;
18
 using System.Diagnostics;
23
 using System.Drawing;
19
 using System.Drawing;
24
-using System.Drawing.Imaging;
25
-using System.Drawing.Printing;
26
 using System.IO;
20
 using System.IO;
27
 using System.Linq;
21
 using System.Linq;
28
 using System.Text.RegularExpressions;
22
 using System.Text.RegularExpressions;
148
         /// </summary>
142
         /// </summary>
149
         public XHMicroLessonSystemWindow()
143
         public XHMicroLessonSystemWindow()
150
         {
144
         {
151
-            new Aspose.Words.License().SetLicense(new MemoryStream(Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4xOTA4MjYwODA3NTM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICAgPC9Qcm9kdWN0cz4KICAgIDxFZGl0aW9uVHlwZT5FbnRlcnByaXNlPC9FZGl0aW9uVHlwZT4KICAgIDxTZXJpYWxOdW1iZXI+M2U0NGRlMzAtZmNkMi00MTA2LWIzNWQtNDZjNmEzNzE1ZmMyPC9TZXJpYWxOdW1iZXI+CiAgICA8U3Vic2NyaXB0aW9uRXhwaXJ5PjIwMjAwODI3PC9TdWJzY3JpcHRpb25FeHBpcnk+CiAgICA8TGljZW5zZVZlcnNpb24+My4wPC9MaWNlbnNlVmVyc2lvbj4KICAgIDxMaWNlbnNlSW5zdHJ1Y3Rpb25zPmh0dHBzOi8vcHVyY2hhc2UuYXNwb3NlLmNvbS9wb2xpY2llcy91c2UtbGljZW5zZTwvTGljZW5zZUluc3RydWN0aW9ucz4KICA8L0RhdGE+CiAgPFNpZ25hdHVyZT53UGJtNUt3ZTYvRFZXWFNIY1o4d2FiVEFQQXlSR0pEOGI3L00zVkV4YWZpQnd5U2h3YWtrNGI5N2c2eGtnTjhtbUFGY3J0c0cwd1ZDcnp6MytVYk9iQjRYUndTZWxsTFdXeXNDL0haTDNpN01SMC9jZUFxaVZFOU0rWndOQkR4RnlRbE9uYTFQajhQMzhzR1grQ3ZsemJLZFZPZXk1S3A2dDN5c0dqYWtaL1E9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=")));
152
-            new Aspose.Pdf.License().SetLicense(new MemoryStream(Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4xOTA4MjYwODA3NTM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICAgPC9Qcm9kdWN0cz4KICAgIDxFZGl0aW9uVHlwZT5FbnRlcnByaXNlPC9FZGl0aW9uVHlwZT4KICAgIDxTZXJpYWxOdW1iZXI+M2U0NGRlMzAtZmNkMi00MTA2LWIzNWQtNDZjNmEzNzE1ZmMyPC9TZXJpYWxOdW1iZXI+CiAgICA8U3Vic2NyaXB0aW9uRXhwaXJ5PjIwMjAwODI3PC9TdWJzY3JpcHRpb25FeHBpcnk+CiAgICA8TGljZW5zZVZlcnNpb24+My4wPC9MaWNlbnNlVmVyc2lvbj4KICAgIDxMaWNlbnNlSW5zdHJ1Y3Rpb25zPmh0dHBzOi8vcHVyY2hhc2UuYXNwb3NlLmNvbS9wb2xpY2llcy91c2UtbGljZW5zZTwvTGljZW5zZUluc3RydWN0aW9ucz4KICA8L0RhdGE+CiAgPFNpZ25hdHVyZT53UGJtNUt3ZTYvRFZXWFNIY1o4d2FiVEFQQXlSR0pEOGI3L00zVkV4YWZpQnd5U2h3YWtrNGI5N2c2eGtnTjhtbUFGY3J0c0cwd1ZDcnp6MytVYk9iQjRYUndTZWxsTFdXeXNDL0haTDNpN01SMC9jZUFxaVZFOU0rWndOQkR4RnlRbE9uYTFQajhQMzhzR1grQ3ZsemJLZFZPZXk1S3A2dDN5c0dqYWtaL1E9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=")));
153
-            new Aspose.Slides.License().SetLicense(new MemoryStream(Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4xOTA4MjYwODA3NTM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICAgPC9Qcm9kdWN0cz4KICAgIDxFZGl0aW9uVHlwZT5FbnRlcnByaXNlPC9FZGl0aW9uVHlwZT4KICAgIDxTZXJpYWxOdW1iZXI+M2U0NGRlMzAtZmNkMi00MTA2LWIzNWQtNDZjNmEzNzE1ZmMyPC9TZXJpYWxOdW1iZXI+CiAgICA8U3Vic2NyaXB0aW9uRXhwaXJ5PjIwMjAwODI3PC9TdWJzY3JpcHRpb25FeHBpcnk+CiAgICA8TGljZW5zZVZlcnNpb24+My4wPC9MaWNlbnNlVmVyc2lvbj4KICAgIDxMaWNlbnNlSW5zdHJ1Y3Rpb25zPmh0dHBzOi8vcHVyY2hhc2UuYXNwb3NlLmNvbS9wb2xpY2llcy91c2UtbGljZW5zZTwvTGljZW5zZUluc3RydWN0aW9ucz4KICA8L0RhdGE+CiAgPFNpZ25hdHVyZT53UGJtNUt3ZTYvRFZXWFNIY1o4d2FiVEFQQXlSR0pEOGI3L00zVkV4YWZpQnd5U2h3YWtrNGI5N2c2eGtnTjhtbUFGY3J0c0cwd1ZDcnp6MytVYk9iQjRYUndTZWxsTFdXeXNDL0haTDNpN01SMC9jZUFxaVZFOU0rWndOQkR4RnlRbE9uYTFQajhQMzhzR1grQ3ZsemJLZFZPZXk1S3A2dDN5c0dqYWtaL1E9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=")));
145
+            byte[] license = Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4xOTA4MjYwODA3NTM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICAgPC9Qcm9kdWN0cz4KICAgIDxFZGl0aW9uVHlwZT5FbnRlcnByaXNlPC9FZGl0aW9uVHlwZT4KICAgIDxTZXJpYWxOdW1iZXI+M2U0NGRlMzAtZmNkMi00MTA2LWIzNWQtNDZjNmEzNzE1ZmMyPC9TZXJpYWxOdW1iZXI+CiAgICA8U3Vic2NyaXB0aW9uRXhwaXJ5PjIwMjAwODI3PC9TdWJzY3JpcHRpb25FeHBpcnk+CiAgICA8TGljZW5zZVZlcnNpb24+My4wPC9MaWNlbnNlVmVyc2lvbj4KICAgIDxMaWNlbnNlSW5zdHJ1Y3Rpb25zPmh0dHBzOi8vcHVyY2hhc2UuYXNwb3NlLmNvbS9wb2xpY2llcy91c2UtbGljZW5zZTwvTGljZW5zZUluc3RydWN0aW9ucz4KICA8L0RhdGE+CiAgPFNpZ25hdHVyZT53UGJtNUt3ZTYvRFZXWFNIY1o4d2FiVEFQQXlSR0pEOGI3L00zVkV4YWZpQnd5U2h3YWtrNGI5N2c2eGtnTjhtbUFGY3J0c0cwd1ZDcnp6MytVYk9iQjRYUndTZWxsTFdXeXNDL0haTDNpN01SMC9jZUFxaVZFOU0rWndOQkR4RnlRbE9uYTFQajhQMzhzR1grQ3ZsemJLZFZPZXk1S3A2dDN5c0dqYWtaL1E9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=");
146
+            new Aspose.Words.License().SetLicense(new MemoryStream(license));
147
+            new Aspose.Pdf.License().SetLicense(new MemoryStream(license));
148
+            new Aspose.Slides.License().SetLicense(new MemoryStream(license));
154
             InitializeComponent();
149
             InitializeComponent();
155
 
150
 
156
             #region 调整文字大小
151
             #region 调整文字大小
663
                     InitializePrint("", GridM.ActualWidth, gridActHeight);
658
                     InitializePrint("", GridM.ActualWidth, gridActHeight);
664
                 }
659
                 }
665
             }
660
             }
666
-            //if (APP.W_PrintWindow == null)
667
-            //{
668
-            //    APP.W_PrintWindow = new PrintWindow
669
-            //    {
670
-            //        Owner = this
671
-            //    };
672
-            //}
673
-            //if (APP.PageDrawList.Count > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[0].PageImagePath))
674
-            //{
675
-            //    APP.W_PrintWindow.Initialize(APP.PageDrawList[0].PageImagePath, GridM.ActualWidth, GridM.ActualHeight);
676
-            //}
677
-            //else
678
-            //{
679
-            //    APP.W_PrintWindow.Initialize("", GridM.ActualWidth, gridActHeight);
680
-            //}
681
-            //APP.W_PrintWindow.ShowDialog();
682
         }
661
         }
683
 
662
 
684
         /// <summary>
663
         /// <summary>
1446
                             // 图片绝对路径集合
1425
                             // 图片绝对路径集合
1447
                             List<string> images = new List<string>();
1426
                             List<string> images = new List<string>();
1448
                             string directoryPath = pathTemp;
1427
                             string directoryPath = pathTemp;
1449
-                            //aspose许可证
1450
-                            //Aspose.Pdf.License l = new Aspose.Pdf.License();
1451
-                            //string licenseName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Aspose.Total.Product.Family.lic");
1452
-                            //l.SetLicense(licenseName);
1428
+
1453
                             //定义Jpeg转换设备
1429
                             //定义Jpeg转换设备
1454
                             Aspose.Pdf.Document document = new Aspose.Pdf.Document(path);
1430
                             Aspose.Pdf.Document document = new Aspose.Pdf.Document(path);
1455
                             Aspose.Pdf.Devices.JpegDevice device = new Aspose.Pdf.Devices.JpegDevice();
1431
                             Aspose.Pdf.Devices.JpegDevice device = new Aspose.Pdf.Devices.JpegDevice();
1770
                         try
1746
                         try
1771
                         {
1747
                         {
1772
                             string paths = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
1748
                             string paths = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
1773
-                            string[] page = ConvertWordToImage(filepath, paths, "", 0, 0, null, 0).ToArray();
1749
+                            WordImgNum += 1;
1750
+                            string[] page = ZAsposeUtil.ConvertWordToImage(filepath, paths, "" + WordImgNum, 0, 0).ToArray();
1774
                             int num = 0;
1751
                             int num = 0;
1775
                             Dispatcher.Invoke(new Action(() =>
1752
                             Dispatcher.Invoke(new Action(() =>
1776
                             {
1753
                             {
1868
             APP.myloading.Hide();
1845
             APP.myloading.Hide();
1869
         }
1846
         }
1870
 
1847
 
1848
+        /// <summary>
1849
+        /// 防止图片地址重复
1850
+        /// </summary>
1851
+        private long WordImgNum = 9999;
1852
+
1871
         /// <summary>
1853
         /// <summary>
1872
         /// 导入文档
1854
         /// 导入文档
1873
         /// </summary>
1855
         /// </summary>
2089
                                   try
2071
                                   try
2090
                                   {
2072
                                   {
2091
                                       string paths = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
2073
                                       string paths = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
2092
-                                      string[] page = ConvertWordToImage(filepath, paths, "", 0, 0, null, 0).ToArray();
2074
+                                      WordImgNum += 1;
2075
+                                      string[] page = ZAsposeUtil.ConvertWordToImage(filepath, paths, "" + WordImgNum, 0, 0).ToArray();
2093
                                       int num = 0;
2076
                                       int num = 0;
2094
                                       for (int i = 0 + APP.PageContextData.pagenum; i < page.Length + APP.PageContextData.pagenum; i++)//给画板模型加图片路径
2077
                                       for (int i = 0 + APP.PageContextData.pagenum; i < page.Length + APP.PageContextData.pagenum; i++)//给画板模型加图片路径
2095
                                       {
2078
                                       {
2198
             }
2181
             }
2199
         }
2182
         }
2200
 
2183
 
2201
-        /// <summary>
2202
-        /// 防止图片地址重复
2203
-        /// </summary>
2204
-        private long WordImgNum = 9999;
2205
-
2206
-        /// <summary>
2207
-        /// 将Word文档转换为图片的方法(该方法基于第三方DLL),你可以像这样调用该方法: ConvertPDF2Image("F:\\PdfFile.doc", "F:\\",
2208
-        /// "ImageFile", 1, 20, ImageFormat.Png, 256);
2209
-        /// </summary>
2210
-        /// <param name="pdfInputPath">Word文件路径</param>
2211
-        /// <param name="imageOutputPath">图片输出路径,如果为空,默认值为Word所在路径</param>
2212
-        /// <param name="imageName">图片的名字,不需要带扩展名,如果为空,默认值为Word的名称</param>
2213
-        /// <param name="startPageNum">从PDF文档的第几页开始转换,如果为0,默认值为1</param>
2214
-        /// <param name="endPageNum">从PDF文档的第几页开始停止转换,如果为0,默认值为Word总页数</param>
2215
-        /// <param name="imageFormat">设置所需图片格式,如果为null,默认格式为PNG</param>
2216
-        /// <param name="resolution">设置图片的像素,数字越大越清晰,如果为0,默认值为128,建议最大值不要超过1024</param>
2217
-        public List<string> ConvertWordToImage(string wordInputPath, string imageOutputPath,
2218
-            string imageName, int startPageNum, int endPageNum, ImageFormat imageFormat, float resolution)
2219
-        {
2220
-            // 返回的图片绝对路径集合
2221
-            List<string> images = new List<string>();
2222
-            try
2223
-            {
2224
-                // open word file
2225
-                Aspose.Words.Document doc = new Aspose.Words.Document(wordInputPath);
2226
-
2227
-                // validate parameter
2228
-                if (doc == null) { throw new Exception("Word文件无效或者Word文件被加密!"); }
2229
-                if (imageOutputPath.Trim().Length == 0) { imageOutputPath = System.IO.Path.GetDirectoryName(wordInputPath); }
2230
-                if (!Directory.Exists(imageOutputPath)) { Directory.CreateDirectory(imageOutputPath); }
2231
-                if (imageName.Trim().Length == 0) { imageName = System.IO.Path.GetFileNameWithoutExtension(wordInputPath); }
2232
-                if (startPageNum <= 0) { startPageNum = 1; }
2233
-                if (endPageNum > doc.PageCount || endPageNum <= 0) { endPageNum = doc.PageCount; }
2234
-                if (startPageNum > endPageNum) { int tempPageNum = startPageNum; startPageNum = endPageNum; endPageNum = startPageNum; }
2235
-                if (imageFormat == null) { imageFormat = ImageFormat.Png; }
2236
-                if (resolution <= 0) { resolution = 128; }
2237
-
2238
-                ImageSaveOptions imageSaveOptions = new ImageSaveOptions(GetSaveFormat(imageFormat))
2239
-                {
2240
-                    Resolution = resolution
2241
-                };
2242
-
2243
-                // start to convert each page
2244
-                for (int i = startPageNum; i <= endPageNum; i++)
2245
-                {
2246
-                    imageSaveOptions.PageIndex = i - 1;
2247
-                    doc.Save(System.IO.Path.Combine(imageOutputPath, imageName) + "_" + WordImgNum.ToString() + "." + imageFormat.ToString(), imageSaveOptions);
2248
-                    images.Add(System.IO.Path.Combine(imageOutputPath, imageName) + "_" + WordImgNum.ToString() + "." + imageFormat.ToString());
2249
-                    WordImgNum++;
2250
-                }
2251
-                imageSaveOptions = null;
2252
-                doc = null;
2253
-            }
2254
-            catch (Exception ex)
2255
-            {
2256
-                //if(ex.Message.ToString().Equals("{\"The document appears to be corrupted and cannot be loaded.\"}"))
2257
-                //{
2258
-                //    MessageWindow.Show("Word文件无效或者Word文件被加密!");
2259
-                //}
2260
-                //else
2261
-                //{
2262
-                MessageWindow.Show("该文件无法使用!");
2263
-                //}
2264
-                LogHelper.WriteErrLog("【导入方法(ConvertWordToImage)】错误日志:" + ex.Message, ex);
2265
-            }
2266
-            return images;
2267
-        }
2268
-
2269
-        private static Aspose.Words.SaveFormat GetSaveFormat(ImageFormat imageFormat)
2270
-        {
2271
-            Aspose.Words.SaveFormat sf;// = SaveFormat.Unknown;
2272
-            if (imageFormat.Equals(ImageFormat.Png))
2273
-            {
2274
-                sf = Aspose.Words.SaveFormat.Png;
2275
-            }
2276
-            else if (imageFormat.Equals(ImageFormat.Jpeg))
2277
-            {
2278
-                sf = Aspose.Words.SaveFormat.Jpeg;
2279
-            }
2280
-            else if (imageFormat.Equals(ImageFormat.Tiff))
2281
-            {
2282
-                sf = Aspose.Words.SaveFormat.Tiff;
2283
-            }
2284
-            else if (imageFormat.Equals(ImageFormat.Bmp))
2285
-            {
2286
-                sf = Aspose.Words.SaveFormat.Bmp;
2287
-            }
2288
-            else
2289
-            {
2290
-                sf = Aspose.Words.SaveFormat.Unknown;
2291
-            }
2292
-
2293
-            return sf;
2294
-        }
2295
-
2296
         #endregion 导入转换图片
2184
         #endregion 导入转换图片
2297
 
2185
 
2298
         #endregion 导入截图
2186
         #endregion 导入截图
3210
         private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
3098
         private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
3211
         {
3099
         {
3212
             Record();
3100
             Record();
3213
-            if (!APP.CheckScreenCapturerRecorder())
3214
-            {
3215
-                MessageWindow.Show("使用此功能需安装环境,请在确定后依次点击“OK-Next>-Next>Install”完成安装!");
3216
-                //APP.InstallScreenCapturerRecorder();
3217
-                return;
3218
-            }
3101
+            //if (!APP.CheckScreenCapturerRecorder())
3102
+            //{
3103
+            //    MessageWindow.Show("使用此功能需安装环境,请在确定后依次点击“OK-Next>-Next>Install”完成安装!");
3104
+            //    //APP.InstallScreenCapturerRecorder();
3105
+            //    return;
3106
+            //}
3219
 
3107
 
3220
             k_hook.Stop();
3108
             k_hook.Stop();
3221
             if (APP.W_ScreenRecordingToolbarWindow == null)
3109
             if (APP.W_ScreenRecordingToolbarWindow == null)
3279
         #region 变量
3167
         #region 变量
3280
 
3168
 
3281
         /// <summary>
3169
         /// <summary>
3282
-        /// 音频保存路径名
3170
+        /// 视频合成前路径名
3283
         /// </summary>
3171
         /// </summary>
3284
-        private string AudioPathName;
3172
+        private string TempVideoPathName;
3285
 
3173
 
3286
         /// <summary>
3174
         /// <summary>
3287
-        /// 频保存路径名
3175
+        /// 频保存路径名
3288
         /// </summary>
3176
         /// </summary>
3289
-        private string VideoSavePathName;
3177
+        private string TempAudioPathName;
3290
 
3178
 
3291
         /// <summary>
3179
         /// <summary>
3292
-        /// 视频合成路径名
3180
+        /// 视频保存路径名
3293
         /// </summary>
3181
         /// </summary>
3294
-        private string VideoSynthesisPathName;
3295
-
3182
+        private string VideoSavePathName;
3296
         /// <summary>
3183
         /// <summary>
3297
         /// 截图定时器
3184
         /// 截图定时器
3298
         /// </summary>
3185
         /// </summary>
3340
                 IsPressButton = true;
3227
                 IsPressButton = true;
3341
                 new Thread(new ThreadStart(new Action(() =>
3228
                 new Thread(new ThreadStart(new Action(() =>
3342
                 {
3229
                 {
3343
-                    Thread.Sleep(3000);
3230
+                    Thread.Sleep(1000);
3344
                     IsPressButton = false;
3231
                     IsPressButton = false;
3345
                 }))).Start();
3232
                 }))).Start();
3346
             }
3233
             }
3370
 
3257
 
3371
                 #region 检测麦克风扬声器是否可用
3258
                 #region 检测麦克风扬声器是否可用
3372
 
3259
 
3373
-                string AudioPath = FileToolsCommon.GetFileAbsolutePath("/temp/audio/");
3374
-                FileToolsCommon.CreateDirectory(AudioPath);
3375
-                string audioMicrophonePath = AudioPath + "adoM" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".m";
3376
-                try
3377
-                {
3378
-                    FileToolsCommon.DeleteFile(audioMicrophonePath);
3379
-                }
3380
-                catch (Exception)
3381
-                {
3382
-                }
3383
-                //麦克风
3384
-                if (APP.FFmpeg.StartRecordAudio(audioMicrophonePath))
3385
-                {
3386
-                    APP.FFmpeg.StopRecordAudio(1);
3387
-                }
3388
-                else
3389
-                {
3390
-                    //无法录制麦克风
3391
-                    MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制麦克风,是否继续?", "消息提示", MessageBoxButton.OKCancel);
3392
-                    if (Res == MessageBoxResult.Cancel)
3393
-                    {
3394
-                        return;
3395
-                    }
3396
-                }
3260
+                //string AudioPath = FileToolsCommon.GetFileAbsolutePath("/temp/audio/");
3261
+                //FileToolsCommon.CreateDirectory(AudioPath);
3262
+                //string audioMicrophonePath = AudioPath + "adoM" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".m";
3263
+                //try
3264
+                //{
3265
+                //    FileToolsCommon.DeleteFile(audioMicrophonePath);
3266
+                //}
3267
+                //catch (Exception)
3268
+                //{
3269
+                //}
3270
+                ////麦克风
3271
+                //if (APP.FFmpeg.StartRecordAudio(audioMicrophonePath))
3272
+                //{
3273
+                //    APP.FFmpeg.StopRecordAudio(1);
3274
+                //}
3275
+                //else
3276
+                //{
3277
+                //    //无法录制麦克风
3278
+                //    MessageBoxResult Res = MessageWindow.Show("当前电脑无法录制麦克风,是否继续?", "消息提示", MessageBoxButton.OKCancel);
3279
+                //    if (Res == MessageBoxResult.Cancel)
3280
+                //    {
3281
+                //        return;
3282
+                //    }
3283
+                //}
3397
 
3284
 
3398
                 #endregion 检测麦克风扬声器是否可用
3285
                 #endregion 检测麦克风扬声器是否可用
3399
 
3286
 
3432
                 new Thread(new ThreadStart(new Action(() =>
3319
                 new Thread(new ThreadStart(new Action(() =>
3433
                 {
3320
                 {
3434
                     Thread.Sleep(3000);
3321
                     Thread.Sleep(3000);
3435
-                   
3322
+
3436
                     Dispatcher.Invoke(() =>
3323
                     Dispatcher.Invoke(() =>
3437
                     {
3324
                     {
3438
-                       
3439
                         TxbType.Text = "正在录制";
3325
                         TxbType.Text = "正在录制";
3440
                     });
3326
                     });
3441
                     RecordType = 1;
3327
                     RecordType = 1;
3446
             {
3332
             {
3447
                 //录制中暂停
3333
                 //录制中暂停
3448
                 RecordType = 2;
3334
                 RecordType = 2;
3449
-     
3450
             }
3335
             }
3451
             else if (RecordType == 2)
3336
             else if (RecordType == 2)
3452
             {
3337
             {
3465
             else if (RecordType == 1)
3350
             else if (RecordType == 1)
3466
             {
3351
             {
3467
                 TxbType.Text = "录制中";
3352
                 TxbType.Text = "录制中";
3353
+                BtnRecord.Content = "暂停录制";
3354
+                BtnRecord.Visibility = Visibility.Collapsed;
3355
+                BtnRecordSuspend.Visibility = Visibility.Visible;
3468
             }
3356
             }
3469
             else if (RecordType == 2)
3357
             else if (RecordType == 2)
3470
             {
3358
             {
3540
                 WkType = Enum_WKVidetype.RecordingLessons
3428
                 WkType = Enum_WKVidetype.RecordingLessons
3541
             };
3429
             };
3542
 
3430
 
3543
-     
3544
             FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
3431
             FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
3545
             FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
3432
             FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
3546
 
3433
 
3547
             VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制." + VideoInfo.VideoType.ToString();
3434
             VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制." + VideoInfo.VideoType.ToString();
3548
 
3435
 
3549
-            VideoSynthesisPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制Syn.avi";
3436
+            TempVideoPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制Syn.avi";
3550
             int num = 1;
3437
             int num = 1;
3551
             while (FileToolsCommon.IsExistFile(VideoSavePathName))
3438
             while (FileToolsCommon.IsExistFile(VideoSavePathName))
3552
             {
3439
             {
3553
                 VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制_" + num + "." + VideoInfo.VideoType.ToString();
3440
                 VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制_" + num + "." + VideoInfo.VideoType.ToString();
3554
-                VideoSynthesisPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制Syn_" + num + ".avi";
3441
+                TempVideoPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录制Syn_" + num + ".avi";
3555
                 num++;
3442
                 num++;
3556
             }
3443
             }
3557
 
3444
 
3558
-            AudioPathName = VideoSynthesisPathName.Replace(".avi", ".mp3");
3445
+            TempAudioPathName = TempVideoPathName.Replace(".avi", ".mp3");
3559
             gridActWidth = (int)(GridMain.ActualWidth * (PrimaryScreen.DpiX / 96f) / 2) * 2;
3446
             gridActWidth = (int)(GridMain.ActualWidth * (PrimaryScreen.DpiX / 96f) / 2) * 2;
3560
             gridActHeight = (int)(GridMain.ActualHeight * (PrimaryScreen.DpiY / 96f) / 2) * 2;
3447
             gridActHeight = (int)(GridMain.ActualHeight * (PrimaryScreen.DpiY / 96f) / 2) * 2;
3561
 
3448
 
3562
             lock (this)
3449
             lock (this)
3563
             {
3450
             {
3564
                 videoWriter.Open(
3451
                 videoWriter.Open(
3565
-                    VideoSynthesisPathName,
3452
+                    TempVideoPathName,
3566
                     gridActWidth,
3453
                     gridActWidth,
3567
                     gridActHeight,
3454
                     gridActHeight,
3568
                     5,
3455
                     5,
3571
                 );
3458
                 );
3572
 
3459
 
3573
                 waveIn = new WaveInEvent();
3460
                 waveIn = new WaveInEvent();
3574
-                writer = new WaveFileWriter(AudioPathName, waveIn.WaveFormat);
3461
+                writer = new WaveFileWriter(TempAudioPathName, waveIn.WaveFormat);
3575
                 //开始录音,写数据
3462
                 //开始录音,写数据
3576
                 waveIn.DataAvailable += (s, a) =>
3463
                 waveIn.DataAvailable += (s, a) =>
3577
                 {
3464
                 {
3598
             });
3485
             });
3599
 
3486
 
3600
             ///启动截图
3487
             ///启动截图
3601
-            timer = new System.Threading.Timer(new TimerCallback(Timer_Elapsed), null, 0, 20);
3488
+            timer = new System.Threading.Timer(new TimerCallback(Timer_Elapsed), null, 0, 200);
3602
         }
3489
         }
3603
 
3490
 
3604
         /// <summary>
3491
         /// <summary>
3614
         {
3501
         {
3615
             if (RecordType == 1)
3502
             if (RecordType == 1)
3616
             {
3503
             {
3617
-                DateTime dt = DateTime.Now;
3618
-                TimeSpan ts = dt.Subtract(Recorddt);//时间差
3619
-                double tsmi = ts.TotalMilliseconds;
3620
-                if (tsmi >= 200.0)
3504
+                Dispatcher.Invoke(() =>
3621
                 {
3505
                 {
3622
-                    Dispatcher.Invoke(() =>
3623
-                    {
3624
-
3625
-                        SRTime = SRTime.AddMilliseconds(200);
3626
-
3627
-                        if (SRTime.Hour > 0)
3628
-                        {
3629
-                            TxbTime.Text = SRTime.ToString("HH:mm:ss");
3630
-                        }
3631
-                        else
3632
-                        {
3633
-                            TxbTime.Text = SRTime.ToString("mm:ss");
3634
-                        }
3506
+                    SRTime = SRTime.AddMilliseconds(200);
3635
 
3507
 
3636
-                    });
3637
-                    Recorddt = Recorddt.AddMilliseconds(200);
3638
-
3639
-                    ThreadPool.QueueUserWorkItem(o =>
3640
-                        {
3641
-                            RecordSaveImage();
3642
-                        });
3508
+                    if (SRTime.Hour > 0)
3509
+                    {
3510
+                        TxbTime.Text = SRTime.ToString("HH:mm:ss");
3643
                     }
3511
                     }
3644
-                }
3512
+                    else
3513
+                    {
3514
+                        TxbTime.Text = SRTime.ToString("mm:ss");
3515
+                    }
3516
+                });
3517
+
3518
+                ThreadPool.QueueUserWorkItem(o =>
3519
+                {
3520
+                    RecordSaveImage();
3521
+                });
3522
+            }
3645
         }
3523
         }
3646
 
3524
 
3647
         /// <summary>
3525
         /// <summary>
3651
         {
3529
         {
3652
             try
3530
             try
3653
             {
3531
             {
3654
-                #region 设置大小
3655
-
3656
-                int RsW = (int)(GridMain.ActualWidth * (PrimaryScreen.DpiX / 96f) / 2) * 2;
3657
-                int RsH = (int)(GridMain.ActualHeight * (PrimaryScreen.DpiY / 96f) / 2) * 2;
3658
-
3659
-                #endregion 设置大小
3660
 
3532
 
3661
                 //保存图片
3533
                 //保存图片
3662
 
3534
 
3663
-                try {
3535
+                try
3536
+                {
3664
                     Dispatcher.Invoke(() =>
3537
                     Dispatcher.Invoke(() =>
3665
                     {
3538
                     {
3666
-
3667
-                        Bitmap bm = ImageHelper.SaveUI2Bitmap(GridMain, RsW, RsH);
3539
+                        Bitmap bm = ImageHelper.SaveUI2Bitmap(GridMain, gridActWidth, gridActHeight);
3668
 
3540
 
3669
                         videoWriter.WriteVideoFrame(bm);
3541
                         videoWriter.WriteVideoFrame(bm);
3670
                         bm.Dispose();
3542
                         bm.Dispose();
3671
                     });
3543
                     });
3672
                 }
3544
                 }
3673
-                catch (Exception e) {
3545
+                catch (Exception e)
3546
+                {
3674
                     Console.WriteLine(e.Message);
3547
                     Console.WriteLine(e.Message);
3675
                 }
3548
                 }
3676
-
3677
-                
3678
             }
3549
             }
3679
             catch (Exception ex)
3550
             catch (Exception ex)
3680
             {
3551
             {
3748
                     timer.Dispose();
3619
                     timer.Dispose();
3749
 
3620
 
3750
                     TxbTime.Text = "00:00";
3621
                     TxbTime.Text = "00:00";
3751
-
3752
                     TxbType.Text = "保存中";
3622
                     TxbType.Text = "保存中";
3753
                 });
3623
                 });
3754
 
3624
 
3755
-                //合成视频
3756
-                Dispatcher.Invoke(() =>
3757
-                {
3758
-                    TxbType.Text = "转码中";
3759
-                });
3760
-
3761
                 FileToolsCommon.DeleteFile(ThumbnailPathName);
3625
                 FileToolsCommon.DeleteFile(ThumbnailPathName);
3762
                 VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
3626
                 VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
3763
                 VideoInfo.VideoPath = VideoSavePathName;
3627
                 VideoInfo.VideoPath = VideoSavePathName;
3764
                 VideoInfo.ThumbnailPath = ThumbnailPathName;
3628
                 VideoInfo.ThumbnailPath = ThumbnailPathName;
3765
                 Console.WriteLine("生成缩略图");
3629
                 Console.WriteLine("生成缩略图");
3766
-                //生成缩略图
3767
-                bool ThuRes = APP.FFmpeg.GenerateThumbnails(VideoSynthesisPathName, ThumbnailPathName, 200, 130);
3768
-                Thread.Sleep(500);
3630
+
3769
                 Console.WriteLine("合并音视频 gridActWidth:" + gridActWidth + " gridActHeight:" + gridActHeight);
3631
                 Console.WriteLine("合并音视频 gridActWidth:" + gridActWidth + " gridActHeight:" + gridActHeight);
3770
 
3632
 
3771
                 //APP.FFmpeg.VideoAudioMerge(VideoSynthesisPathName, AudioPathName, VideoSavePathName, gridActWidth, gridActHeight);
3633
                 //APP.FFmpeg.VideoAudioMerge(VideoSynthesisPathName, AudioPathName, VideoSavePathName, gridActWidth, gridActHeight);
3772
                 FFMpegConverter ffMpeg = new FFMpegConverter();
3634
                 FFMpegConverter ffMpeg = new FFMpegConverter();
3773
                 //ffMpeg.ConvertProgress += FfMpeg_ConvertProgress;
3635
                 //ffMpeg.ConvertProgress += FfMpeg_ConvertProgress;
3774
                 FFMpegInput[] input = new FFMpegInput[] {
3636
                 FFMpegInput[] input = new FFMpegInput[] {
3775
-                    new FFMpegInput(VideoSynthesisPathName),
3776
-                    new FFMpegInput(AudioPathName)
3637
+                    new FFMpegInput(TempVideoPathName),
3638
+                    new FFMpegInput(TempAudioPathName)
3777
                 };
3639
                 };
3778
 
3640
 
3779
                 // 音视频合并
3641
                 // 音视频合并
3781
                     input,
3643
                     input,
3782
                     VideoSavePathName,
3644
                     VideoSavePathName,
3783
                     "mp4",
3645
                     "mp4",
3784
-                    new OutputSettings(){}
3646
+                    new OutputSettings() { }
3785
                 );
3647
                 );
3786
 
3648
 
3649
+                //生成缩略图
3650
+                bool ThuRes = APP.FFmpeg.GenerateThumbnails(TempVideoPathName, ThumbnailPathName, 200, 130);
3651
+
3787
                 VideoInfo.FileGuid = Guid.NewGuid().ToString();
3652
                 VideoInfo.FileGuid = Guid.NewGuid().ToString();
3788
                 VideoInfo.IsUpload = false;
3653
                 VideoInfo.IsUpload = false;
3789
                 VideoInfo.Uploaded = 0;
3654
                 VideoInfo.Uploaded = 0;
3795
                     APP.SaveWkData();
3660
                     APP.SaveWkData();
3796
                 }
3661
                 }
3797
 
3662
 
3663
+                FileToolsCommon.DeleteFile(TempVideoPathName);
3664
+                FileToolsCommon.DeleteFile(TempAudioPathName);
3665
+
3798
                 Dispatcher.Invoke(() =>
3666
                 Dispatcher.Invoke(() =>
3799
                 {
3667
                 {
3800
                     BtnRecord.IsEnabled = true;
3668
                     BtnRecord.IsEnabled = true;
6092
         public void InitPrint()
5960
         public void InitPrint()
6093
         {
5961
         {
6094
             ResizeMode = ResizeMode.NoResize;
5962
             ResizeMode = ResizeMode.NoResize;
6095
-            List<string> defaList = PrintUtils.GetLocalPrinters();
5963
+            List<string> defaList = ZPrintUtils.GetLocalPrinters();
6096
             if (defaList.Count > 0)
5964
             if (defaList.Count > 0)
6097
             {
5965
             {
6098
                 printlist.Columns.Add("Value");
5966
                 printlist.Columns.Add("Value");
6312
                         string fileName = strs[i];
6180
                         string fileName = strs[i];
6313
 
6181
 
6314
                         //打印文件
6182
                         //打印文件
6315
-                        PrintUtils.Print(fileName, PrinterName);
6183
+                        ZPrintUtils.Print(fileName, PrinterName);
6316
                     }
6184
                     }
6317
 
6185
 
6318
                     Dispatcher.Invoke(() =>
6186
                     Dispatcher.Invoke(() =>
6403
             #endregion 拓思德打印
6271
             #endregion 拓思德打印
6404
         }
6272
         }
6405
 
6273
 
6406
-        /// <summary>
6407
-        /// 调用打印机打印
6408
-        /// </summary>
6409
-        /// <param name="PDFPath">PDF文件路径</param>
6410
-        /// <param name="PrinterName">打印机名称</param>
6411
-        private void Print(string PDFPath, string PrinterName, short PrinterNum = 1)
6412
-        {
6413
-            Console.WriteLine("PDFPath:" + PDFPath);
6414
-            //PDFPath = "D:/123.pdf";
6415
-            //加载PDF文档
6416
-            PdfDocument doc = new PdfDocument();
6417
-            doc.LoadFromFile(PDFPath);
6418
-
6419
-            //指定打印机
6420
-            doc.PrintSettings.PrinterName = PrinterName;
6421
-
6422
-            //静默打印PDF文档
6423
-            doc.PrintSettings.PrintController = new StandardPrintController();
6424
-
6425
-            ////设置文档打印页码范围
6426
-            //doc.PrintSettings.SelectPageRange(1, 5);
6427
-
6428
-            //打印不连续的页面
6429
-            //doc.PrintSettings.SelectSomePages(new int[] { 1, 3, 5, 7 });
6430
-
6431
-            //设置打印份数为2份
6432
-            doc.PrintSettings.Copies = PrinterNum;
6433
-
6434
-            doc.PrintSettings.PrinterResolutionKind = PdfPrinterResolutionKind.High;
6435
-            //获取原文档第一页的纸张大小,这里的单位是Point
6436
-
6437
-            doc.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.ActualSize, true);
6438
-            //打印PDF文档
6439
-
6440
-            doc.Print();
6441
-        }
6442
-
6443
         /// <summary>
6274
         /// <summary>
6444
         /// 生成图片
6275
         /// 生成图片
6445
         /// </summary>
6276
         /// </summary>

+ 4
- 7
XHWK.WKTool/XHWK.WKTool.csproj View File

156
       <SpecificVersion>False</SpecificVersion>
156
       <SpecificVersion>False</SpecificVersion>
157
       <HintPath>..\DLL\Robot\RobotpenGateway.dll</HintPath>
157
       <HintPath>..\DLL\Robot\RobotpenGateway.dll</HintPath>
158
     </Reference>
158
     </Reference>
159
-    <Reference Include="Spire.License, Version=1.3.8.40, Culture=neutral, PublicKeyToken=b1144360237c8b3f, processorArchitecture=MSIL">
160
-      <HintPath>..\packages\FreeSpire.PDF.7.2.0\lib\net40\Spire.License.dll</HintPath>
161
-    </Reference>
162
-    <Reference Include="Spire.Pdf, Version=7.2.6.0, Culture=neutral, PublicKeyToken=663f351905198cb3, processorArchitecture=MSIL">
163
-      <HintPath>..\packages\FreeSpire.PDF.7.2.0\lib\net40\Spire.Pdf.dll</HintPath>
164
-    </Reference>
165
     <Reference Include="System" />
159
     <Reference Include="System" />
166
     <Reference Include="System.Configuration" />
160
     <Reference Include="System.Configuration" />
167
     <Reference Include="System.Data" />
161
     <Reference Include="System.Data" />
333
     <Compile Include="UploadWindow.xaml.cs">
327
     <Compile Include="UploadWindow.xaml.cs">
334
       <DependentUpon>UploadWindow.xaml</DependentUpon>
328
       <DependentUpon>UploadWindow.xaml</DependentUpon>
335
     </Compile>
329
     </Compile>
336
-    <Compile Include="Utils\PrintUtils.cs" />
330
+    <Compile Include="Utils\ZAsposeUtil.cs" />
331
+    <Compile Include="Utils\ZVideoRecordHelper.cs" />
332
+    <Compile Include="Utils\ZAudioRecordHelper.cs" />
333
+    <Compile Include="Utils\ZPrintUtils.cs" />
337
     <Compile Include="VideoClipWindow.xaml.cs">
334
     <Compile Include="VideoClipWindow.xaml.cs">
338
       <DependentUpon>VideoClipWindow.xaml</DependentUpon>
335
       <DependentUpon>VideoClipWindow.xaml</DependentUpon>
339
     </Compile>
336
     </Compile>

+ 0
- 1
XHWK.WKTool/packages.config View File

14
   <package id="Aspose.Slides.NET" version="19.10.0" targetFramework="net452" />
14
   <package id="Aspose.Slides.NET" version="19.10.0" targetFramework="net452" />
15
   <package id="Aspose.Words" version="19.1.0" targetFramework="net452" />
15
   <package id="Aspose.Words" version="19.1.0" targetFramework="net452" />
16
   <package id="BouncyCastle" version="1.8.6.1" targetFramework="net452" />
16
   <package id="BouncyCastle" version="1.8.6.1" targetFramework="net452" />
17
-  <package id="FreeSpire.PDF" version="7.2.0" targetFramework="net452" />
18
   <package id="ICSharpCode.SharpZipLib.dll" version="0.85.4.369" targetFramework="net452" />
17
   <package id="ICSharpCode.SharpZipLib.dll" version="0.85.4.369" targetFramework="net452" />
19
   <package id="iTextSharp" version="5.5.13.2" targetFramework="net452" />
18
   <package id="iTextSharp" version="5.5.13.2" targetFramework="net452" />
20
   <package id="log4net" version="2.0.12" targetFramework="net452" />
19
   <package id="log4net" version="2.0.12" targetFramework="net452" />

+ 93
- 11
打包脚本/Inno Setup星火微课.iss View File

3
 
3
 
4
 #define MyAppName "星火微课"  
4
 #define MyAppName "星火微课"  
5
 #define MyAppDir "xhwk"
5
 #define MyAppDir "xhwk"
6
-#define MyAppVersion "2.6.1"
6
+#define MyAppVersion "2.6.2"
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\C#\xhwkclient\XHWK.WKTool\bin\x86\Debug\"
9
 #define MySourcePath "D:\Project\C#\xhwkclient\XHWK.WKTool\bin\x86\Debug\"
45
 
45
 
46
 [Files]
46
 [Files]
47
 Source: "{#MySourcePath}{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
47
 Source: "{#MySourcePath}{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
48
-Source: "{#MySourcePath}*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
49
-; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”
48
+Source: "{#MySourcePath}*"; Excludes: "ffmpeg.exe,\Log\*,\Temp,\Data";DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
50
 
49
 
51
 [Icons]
50
 [Icons]
52
 Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
51
 Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
56
 [Run]
55
 [Run]
57
 Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
56
 Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
58
 
57
 
59
-[Code]   
58
+[Code]  
59
+// Indicates whether the specified version and service pack of the .NET Framework is installed.
60
+//
61
+// version -- Specify one of these strings for the required .NET Framework version:
62
+//    'v1.1'          .NET Framework 1.1
63
+//    'v2.0'          .NET Framework 2.0
64
+//    'v3.0'          .NET Framework 3.0
65
+//    'v3.5'          .NET Framework 3.5
66
+//    'v4\Client'     .NET Framework 4.0 Client Profile
67
+//    'v4\Full'       .NET Framework 4.0 Full Installation
68
+//    'v4.5'          .NET Framework 4.5
69
+//    'v4.5.1'        .NET Framework 4.5.1
70
+//    'v4.5.2'        .NET Framework 4.5.2
71
+//    'v4.6'          .NET Framework 4.6
72
+//    'v4.6.1'        .NET Framework 4.6.1
73
+//    'v4.6.2'        .NET Framework 4.6.2
74
+//    'v4.7'          .NET Framework 4.7
75
+//    'v4.7.1'        .NET Framework 4.7.1
76
+//    'v4.7.2'        .NET Framework 4.7.2
77
+//    'v4.8'          .NET Framework 4.8
78
+//
79
+// service -- Specify any non-negative integer for the required service pack level:
80
+//    0               No service packs required
81
+//    1, 2, etc.      Service pack 1, 2, etc. required
82
+function IsDotNetDetected(version: string; service: cardinal): boolean;
83
+var
84
+    key, versionKey: string;
85
+    install, release, serviceCount, versionRelease: cardinal;
86
+    success: boolean;
87
+begin
88
+    versionKey := version;
89
+    versionRelease := 0;
90
+
91
+    // .NET 1.1 and 2.0 embed release number in version key
92
+    if version = 'v1.1' then begin
93
+        versionKey := 'v1.1.4322';
94
+    end
95
+    else if version = 'v2.0' then begin
96
+        versionKey := 'v2.0.50727';
97
+    end
98
+
99
+    // .NET 4.5 and newer install as update to .NET 4.0 Full
100
+    else if Pos('v4.', version) = 1 then begin
101
+        versionKey := 'v4\Full';
102
+        case version of
103
+          'v4.5':   versionRelease := 378389;
104
+          'v4.5.1': versionRelease := 378675; // 378758 on Windows 8 and older
105
+          'v4.5.2': versionRelease := 379893;
106
+          'v4.6':   versionRelease := 393295; // 393297 on Windows 8.1 and older
107
+          'v4.6.1': versionRelease := 394254; // 394271 on Windows 8.1 and older
108
+          'v4.6.2': versionRelease := 394802; // 394806 on Windows 8.1 and older
109
+          'v4.7':   versionRelease := 460798; // Windows 10
110
+          'v4.7.1': versionRelease := 461308; // Windows 10
111
+          'v4.7.2': versionRelease := 461808; // Windows 10
112
+          'v4.8'  : versionRelease := 528040; // Windows 10
113
+        end;
114
+    end;
115
+
116
+    // installation key group for all .NET versions
117
+    key := 'SOFTWARE\Microsoft\NET Framework Setup\NDP\' + versionKey;
118
+
119
+    // .NET 3.0 uses value InstallSuccess in subkey Setup
120
+    if Pos('v3.0', version) = 1 then begin
121
+        success := RegQueryDWordValue(HKLM, key + '\Setup', 'InstallSuccess', install);
122
+    end else begin
123
+        success := RegQueryDWordValue(HKLM, key, 'Install', install);
124
+    end;
125
+
126
+    // .NET 4.0 and newer use value Servicing instead of SP
127
+    if Pos('v4', version) = 1 then begin
128
+        success := success and RegQueryDWordValue(HKLM, key, 'Servicing', serviceCount);
129
+    end else begin
130
+        success := success and RegQueryDWordValue(HKLM, key, 'SP', serviceCount);
131
+    end;
132
+
133
+    // .NET 4.5 and newer use additional value Release
134
+    if versionRelease > 0 then begin
135
+        success := success and RegQueryDWordValue(HKLM, key, 'Release', release);
136
+        success := success and (release >= versionRelease);
137
+    end;
138
+
139
+    result := success and (install = 1) and (serviceCount >= service);
140
+end;
141
+
60
 function InitializeSetup: Boolean;   
142
 function InitializeSetup: Boolean;   
61
 var Path:string;   
143
 var Path:string;   
62
     ResultCode: Integer;   
144
     ResultCode: Integer;   
63
 begin  
145
 begin  
64
-  if RegValueExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Screen Capturer Recorder_is1', 'DisplayName') then  
146
+  if  IsDotNetDetected('v4.5.2', 0) then  
65
   begin  
147
   begin  
66
     Result := true;   
148
     Result := true;   
67
   end  
149
   end  
68
   else  
150
   else  
69
   begin  
151
   begin  
70
-    if MsgBox('系统检测到您没有安装录制环境,是否立刻下载并安装?', mbConfirmation, MB_YESNO) = idYes then  
152
+    if MsgBox('系统检测到您没有安装.Net Framework4.5.2,是否立刻下载并安装?', mbConfirmation, MB_YESNO) = idYes then  
71
     begin  
153
     begin  
72
       Path := ExpandConstant('{pf}/Internet Explorer/iexplore.exe');   
154
       Path := ExpandConstant('{pf}/Internet Explorer/iexplore.exe');   
73
-      Exec(Path, 'https://xhkjedu.oss-cn-huhehaote.aliyuncs.com/runtime/Setup%20Screen%20Capturer%20Recorder%20v0.12.10.exe', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);   
74
-      MsgBox('请安装好录制环境后,再运行本安装包程序!',mbInformation,MB_OK);   
155
+      Exec(Path, 'https://xhkjedu.oss-cn-huhehaote.aliyuncs.com/runtime/NDP452-KB2901907-x86-x64-AllOS-ENU.exe', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);   
156
+      MsgBox('请安装好.Net Framework环境后,再运行本安装包程序!',mbInformation,MB_OK);   
75
       Result := false;   
157
       Result := false;   
76
     end  
158
     end  
77
     else  
159
     else  
78
     begin  
160
     begin  
79
-      MsgBox('取消后请手动安装录制环境!',mbInformation,MB_OK);   
80
-      Result := true;   
161
+      MsgBox('没有安装.Net Framework环境,无法运行程序,本安装程序即将退出!',mbInformation,MB_OK);   
162
+      Result := false;   
81
     end;   
163
     end;   
82
   end;
164
   end;
83
-end;
165
+end;

Loading…
Cancel
Save