|
@@ -165,7 +165,6 @@ namespace XHWK.WKTool
|
165
|
165
|
luoBoPenUtil.InitlbPen();
|
166
|
166
|
//腾千里
|
167
|
167
|
InitTQLPPen();
|
168
|
|
- InitPrint();
|
169
|
168
|
|
170
|
169
|
SkinSelectInit();
|
171
|
170
|
byte[] license = Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4xOTA4MjYwODA3NTM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICAgPC9Qcm9kdWN0cz4KICAgIDxFZGl0aW9uVHlwZT5FbnRlcnByaXNlPC9FZGl0aW9uVHlwZT4KICAgIDxTZXJpYWxOdW1iZXI+M2U0NGRlMzAtZmNkMi00MTA2LWIzNWQtNDZjNmEzNzE1ZmMyPC9TZXJpYWxOdW1iZXI+CiAgICA8U3Vic2NyaXB0aW9uRXhwaXJ5PjIwMjAwODI3PC9TdWJzY3JpcHRpb25FeHBpcnk+CiAgICA8TGljZW5zZVZlcnNpb24+My4wPC9MaWNlbnNlVmVyc2lvbj4KICAgIDxMaWNlbnNlSW5zdHJ1Y3Rpb25zPmh0dHBzOi8vcHVyY2hhc2UuYXNwb3NlLmNvbS9wb2xpY2llcy91c2UtbGljZW5zZTwvTGljZW5zZUluc3RydWN0aW9ucz4KICA8L0RhdGE+CiAgPFNpZ25hdHVyZT53UGJtNUt3ZTYvRFZXWFNIY1o4d2FiVEFQQXlSR0pEOGI3L00zVkV4YWZpQnd5U2h3YWtrNGI5N2c2eGtnTjhtbUFGY3J0c0cwd1ZDcnp6MytVYk9iQjRYUndTZWxsTFdXeXNDL0haTDNpN01SMC9jZUFxaVZFOU0rWndOQkR4RnlRbE9uYTFQajhQMzhzR1grQ3ZsemJLZFZPZXk1S3A2dDN5c0dqYWtaL1E9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=");
|
|
@@ -180,8 +179,9 @@ namespace XHWK.WKTool
|
180
|
179
|
RectRightDown,
|
181
|
180
|
RectImgBorder,
|
182
|
181
|
imgCanvas,
|
183
|
|
- GridM
|
184
|
|
- );
|
|
182
|
+ GridM);
|
|
183
|
+
|
|
184
|
+ InitPrint();
|
185
|
185
|
}
|
186
|
186
|
|
187
|
187
|
/// <summary>
|
|
@@ -285,11 +285,35 @@ namespace XHWK.WKTool
|
285
|
285
|
/// </param>
|
286
|
286
|
/// <param name="e">
|
287
|
287
|
/// </param>
|
288
|
|
- private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
288
|
+ private async void Window_Loaded(object sender, RoutedEventArgs e)
|
289
|
289
|
{
|
290
|
290
|
//调整录制区域宽高
|
291
|
291
|
double proportion = 210.0 / 297.0;
|
292
|
292
|
GridM.Height = GridM.ActualWidth / proportion;
|
|
293
|
+ await checkDevice();
|
|
294
|
+ }
|
|
295
|
+
|
|
296
|
+ private bool microphoneGood = false;
|
|
297
|
+ private bool loudspeakerGood = false;
|
|
298
|
+
|
|
299
|
+ private async Task checkDevice()
|
|
300
|
+ {
|
|
301
|
+ Task<bool> checkMicrophone = Task.Run(() =>
|
|
302
|
+ {
|
|
303
|
+ return ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.microphone);
|
|
304
|
+ }
|
|
305
|
+ );
|
|
306
|
+
|
|
307
|
+ Task<bool> checkLoudspeaker = Task.Run(
|
|
308
|
+ () =>
|
|
309
|
+ {
|
|
310
|
+ return ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.loudspeaker);
|
|
311
|
+ });
|
|
312
|
+
|
|
313
|
+ await Task.WhenAll(checkMicrophone, checkLoudspeaker);
|
|
314
|
+
|
|
315
|
+ microphoneGood = checkMicrophone.Result;
|
|
316
|
+ loudspeakerGood = checkMicrophone.Result;
|
293
|
317
|
}
|
294
|
318
|
|
295
|
319
|
#endregion 初始化
|
|
@@ -857,7 +881,7 @@ namespace XHWK.WKTool
|
857
|
881
|
/// </param>
|
858
|
882
|
private void btnPrintExplain_Click(object sender, RoutedEventArgs e)
|
859
|
883
|
{
|
860
|
|
- System.Diagnostics.Process.Start(FileToolsCommon.GetFileAbsolutePath("/星火微课点阵码打印及印刷指导手册.docx"));
|
|
884
|
+ Process.Start(FileToolsCommon.GetFileAbsolutePath("/星火微课点阵码打印及印刷指导手册.docx"));
|
861
|
885
|
}
|
862
|
886
|
|
863
|
887
|
private void PageHide()
|
|
@@ -2693,56 +2717,48 @@ namespace XHWK.WKTool
|
2693
|
2717
|
/// </param>
|
2694
|
2718
|
/// <param name="e">
|
2695
|
2719
|
/// </param>
|
2696
|
|
- private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
|
|
2720
|
+ private async void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
|
2697
|
2721
|
{
|
2698
|
2722
|
luoBoPenUtil.lb_device_mouse();
|
2699
|
|
- ThreadPool.QueueUserWorkItem(o =>
|
2700
|
|
- {
|
2701
|
|
- bool microphoneGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.microphone);
|
2702
|
|
- bool loudspeakerGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.loudspeaker);
|
2703
|
2723
|
|
2704
|
|
- Dispatcher.Invoke(() =>
|
2705
|
|
- {
|
2706
|
|
- if (!microphoneGood)
|
2707
|
|
- {
|
2708
|
|
- MessageWindow.Show("麦克风不可用");
|
2709
|
|
- return;
|
2710
|
|
- }
|
|
2724
|
+ if (!microphoneGood)
|
|
2725
|
+ {
|
|
2726
|
+ MessageWindow.Show("麦克风不可用");
|
|
2727
|
+ return;
|
|
2728
|
+ }
|
2711
|
2729
|
|
2712
|
|
- if (!loudspeakerGood)
|
2713
|
|
- {
|
2714
|
|
- MessageWindow.Show("扬声器不可用");
|
2715
|
|
- return;
|
2716
|
|
- }
|
|
2730
|
+ if (!loudspeakerGood)
|
|
2731
|
+ {
|
|
2732
|
+ MessageWindow.Show("扬声器不可用");
|
|
2733
|
+ return;
|
|
2734
|
+ }
|
2717
|
2735
|
|
2718
|
|
- Record();
|
|
2736
|
+ Record();
|
2719
|
2737
|
|
2720
|
|
- k_hook.Stop();
|
2721
|
|
- if (APP.W_ScreenRecordingToolbarWindow == null)
|
2722
|
|
- {
|
2723
|
|
- APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
|
2724
|
|
- {
|
2725
|
|
- Topmost = true
|
2726
|
|
- };
|
2727
|
|
- APP.W_ScreenRecordingToolbarWindow.Initialize();
|
2728
|
|
- }
|
2729
|
|
- else
|
2730
|
|
- {
|
2731
|
|
- APP.W_ScreenRecordingToolbarWindow.Initialize();
|
2732
|
|
- }
|
2733
|
|
- APP.W_ScreenRecordingToolbarWindow.Click_stopRecordingScreen += W_ScreenRecordingToolbarWindow_Click_stopRecordingScreen;
|
2734
|
|
- //显示在右下角
|
2735
|
|
- APP.W_ScreenRecordingToolbarWindow.WindowStartupLocation = WindowStartupLocation.Manual;
|
2736
|
|
- Graphics graphics = Graphics.FromHwnd(IntPtr.Zero);
|
2737
|
|
- float DIP = graphics.DpiX;
|
2738
|
|
- float DIPY = graphics.DpiY;
|
2739
|
|
- APP.W_ScreenRecordingToolbarWindow.Left = PrimaryScreen.WorkingArea.Width / (DIP / 96) - APP.W_ScreenRecordingToolbarWindow.Width;
|
2740
|
|
- APP.W_ScreenRecordingToolbarWindow.Top = PrimaryScreen.WorkingArea.Height / (DIP / 96) - APP.W_ScreenRecordingToolbarWindow.Height - 100;
|
2741
|
|
- APP.W_ScreenRecordingToolbarWindow.Topmost = true;
|
2742
|
|
- APP.W_ScreenRecordingToolbarWindow.Show();
|
2743
|
|
- Hide();
|
2744
|
|
- });
|
2745
|
|
- });
|
|
2738
|
+ k_hook.Stop();
|
|
2739
|
+ if (APP.W_ScreenRecordingToolbarWindow == null)
|
|
2740
|
+ {
|
|
2741
|
+ APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
|
|
2742
|
+ {
|
|
2743
|
+ Topmost = true
|
|
2744
|
+ };
|
|
2745
|
+ APP.W_ScreenRecordingToolbarWindow.Initialize();
|
|
2746
|
+ }
|
|
2747
|
+ else
|
|
2748
|
+ {
|
|
2749
|
+ APP.W_ScreenRecordingToolbarWindow.Initialize();
|
|
2750
|
+ }
|
|
2751
|
+ APP.W_ScreenRecordingToolbarWindow.Click_stopRecordingScreen += W_ScreenRecordingToolbarWindow_Click_stopRecordingScreen;
|
|
2752
|
+ //显示在右下角
|
|
2753
|
+ APP.W_ScreenRecordingToolbarWindow.WindowStartupLocation = WindowStartupLocation.Manual;
|
|
2754
|
+ Graphics graphics = Graphics.FromHwnd(IntPtr.Zero);
|
|
2755
|
+ float DIP = graphics.DpiX;
|
|
2756
|
+ float DIPY = graphics.DpiY;
|
|
2757
|
+ APP.W_ScreenRecordingToolbarWindow.Left = PrimaryScreen.WorkingArea.Width / (DIP / 96) - APP.W_ScreenRecordingToolbarWindow.Width;
|
|
2758
|
+ APP.W_ScreenRecordingToolbarWindow.Top = PrimaryScreen.WorkingArea.Height / (DIP / 96) - APP.W_ScreenRecordingToolbarWindow.Height - 100;
|
|
2759
|
+ APP.W_ScreenRecordingToolbarWindow.Topmost = true;
|
|
2760
|
+ APP.W_ScreenRecordingToolbarWindow.Show();
|
|
2761
|
+ Hide();
|
2746
|
2762
|
}
|
2747
|
2763
|
|
2748
|
2764
|
/// <summary>
|
|
@@ -2751,10 +2767,8 @@ namespace XHWK.WKTool
|
2751
|
2767
|
private void W_ScreenRecordingToolbarWindow_Click_stopRecordingScreen()
|
2752
|
2768
|
{
|
2753
|
2769
|
TxbTime.Text = "00:00";
|
2754
|
|
- //TxbTime.Visibility = Visibility.Hidden;
|
2755
|
|
- //ImgLZImg.Visibility = Visibility.Hidden;
|
2756
|
|
- //TxbType.Visibility = Visibility.Visible;
|
2757
|
2770
|
TxbType.Text = "保存中";
|
|
2771
|
+ RecordType = 1;
|
2758
|
2772
|
BtnScreenRecording.IsEnabled = false;
|
2759
|
2773
|
|
2760
|
2774
|
new Thread(new ThreadStart(new Action(() =>
|
|
@@ -2766,10 +2780,9 @@ namespace XHWK.WKTool
|
2766
|
2780
|
Thread.Sleep(100);
|
2767
|
2781
|
Dispatcher.Invoke(() =>
|
2768
|
2782
|
{
|
|
2783
|
+ RecordType = 0;
|
2769
|
2784
|
BtnScreenRecording.IsEnabled = true;
|
2770
|
2785
|
TxbType.Text = "准备就绪";
|
2771
|
|
- //TxbType.Visibility = Visibility.Hidden;
|
2772
|
|
- //TxbRecordScreenWord.Text = "录屏";
|
2773
|
2786
|
});
|
2774
|
2787
|
}))).Start();
|
2775
|
2788
|
}
|
|
@@ -2875,14 +2888,10 @@ namespace XHWK.WKTool
|
2875
|
2888
|
|
2876
|
2889
|
if (RecordType == 0)
|
2877
|
2890
|
{
|
2878
|
|
- bool microphoneGood = true;
|
2879
|
2891
|
start_pause_grid.Visibility = Visibility.Hidden;
|
2880
|
2892
|
stop_grid.Visibility = Visibility.Hidden;
|
2881
|
2893
|
close_grid.Visibility = Visibility.Hidden;
|
2882
|
|
- await Task.Run(() =>
|
2883
|
|
- {
|
2884
|
|
- microphoneGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.microphone);
|
2885
|
|
- });
|
|
2894
|
+
|
2886
|
2895
|
if (!microphoneGood)
|
2887
|
2896
|
{
|
2888
|
2897
|
start_pause_grid.Visibility = Visibility.Visible;
|
|
@@ -4036,27 +4045,31 @@ namespace XHWK.WKTool
|
4036
|
4045
|
/// <summary>
|
4037
|
4046
|
/// 打印初始化
|
4038
|
4047
|
/// </summary>
|
4039
|
|
- public void InitPrint()
|
|
4048
|
+ public async void InitPrint()
|
4040
|
4049
|
{
|
4041
|
4050
|
ResizeMode = ResizeMode.NoResize;
|
4042
|
|
- List<string> defaList = ZPrintUtils.GetLocalPrinters();
|
4043
|
|
- if (defaList.Count > 0)
|
|
4051
|
+ await Task.Run(() =>
|
4044
|
4052
|
{
|
4045
|
|
- printlist.Columns.Add("Value");
|
4046
|
|
- printlist.Columns.Add("Key");
|
4047
|
|
- for (int i = 0; i < defaList.Count; i++)
|
|
4053
|
+ List<string> defaList = ZPrintUtils.GetLocalPrinters();
|
|
4054
|
+ if (defaList.Count > 0)
|
4048
|
4055
|
{
|
4049
|
|
- //创建一行
|
4050
|
|
- DataRow row = printlist.NewRow();
|
4051
|
|
- //将此行添加到table中
|
4052
|
|
- printlist.Rows.Add(row);
|
4053
|
|
- printlist.Rows[i]["Value"] = defaList[i];
|
4054
|
|
- printlist.Rows[i]["Key"] = i.ToString();
|
|
4056
|
+ printlist.Columns.Add("Value");
|
|
4057
|
+ printlist.Columns.Add("Key");
|
|
4058
|
+ for (int i = 0; i < defaList.Count; i++)
|
|
4059
|
+ {
|
|
4060
|
+ //创建一行
|
|
4061
|
+ DataRow row = printlist.NewRow();
|
|
4062
|
+ //将此行添加到table中
|
|
4063
|
+ printlist.Rows.Add(row);
|
|
4064
|
+ printlist.Rows[i]["Value"] = defaList[i];
|
|
4065
|
+ printlist.Rows[i]["Key"] = i.ToString();
|
|
4066
|
+ }
|
|
4067
|
+ dtComponentsUniqueNo = printlist.DefaultView.ToTable();
|
4055
|
4068
|
}
|
4056
|
|
- dtComponentsUniqueNo = printlist.DefaultView.ToTable();
|
4057
|
|
- cmbClass.ItemsSource = dtComponentsUniqueNo.DefaultView;
|
4058
|
|
- cmbClass.SelectedIndex = 0;
|
4059
|
|
- }
|
|
4069
|
+ });
|
|
4070
|
+
|
|
4071
|
+ cmbClass.ItemsSource = dtComponentsUniqueNo.DefaultView;
|
|
4072
|
+ cmbClass.SelectedIndex = 0;
|
4060
|
4073
|
|
4061
|
4074
|
TQLPrintInit();
|
4062
|
4075
|
}
|