Browse Source

测试 1.2.3(Build 24)

版本更新公告: 1.新增快捷键EXC退出截图。 2.鼠标右键删除截图图片,修改为Delete键删除。
tags/录制修改前
zhangxueyang 4 years ago
parent
commit
caf45879f0

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

33
     <!--上传每片大小 Mb-->
33
     <!--上传每片大小 Mb-->
34
     <add key="UploadSliceLen" value="1" />
34
     <add key="UploadSliceLen" value="1" />
35
     <!--版本号-->
35
     <!--版本号-->
36
-    <add key="VersionCode" value="23" />
37
-    <add key="VersionName" value="1.2.2" />
36
+    <add key="VersionCode" value="24" />
37
+    <add key="VersionName" value="1.2.3" />
38
     <add key="ClientSettingsProvider.ServiceUri" value="" />
38
     <add key="ClientSettingsProvider.ServiceUri" value="" />
39
   </appSettings>
39
   </appSettings>
40
   <system.web>
40
   <system.web>

+ 30
- 1
XHWK.WKTool/JieTuWindow.xaml.cs View File

50
 
50
 
51
         private double _X0 = 0;
51
         private double _X0 = 0;
52
         private double _Y0 = 0;
52
         private double _Y0 = 0;
53
-
53
+        /// <summary>
54
+        /// 键盘钩子
55
+        /// </summary>
56
+        private KeyboardHookCommon k_hook;
54
         //private IntPtr BitmapPtr = IntPtr.Zero;
57
         //private IntPtr BitmapPtr = IntPtr.Zero;
55
         //private IntPtr JieTuBitmapPtr = IntPtr.Zero;
58
         //private IntPtr JieTuBitmapPtr = IntPtr.Zero;
56
         /// <summary>
59
         /// <summary>
60
         {
63
         {
61
             _Current = this;
64
             _Current = this;
62
             InitializeComponent();
65
             InitializeComponent();
66
+            k_hook = new KeyboardHookCommon();
67
+            k_hook.KeyDownEvent += K_hook_KeyDownEvent;
63
             DataContext = new AppModel();
68
             DataContext = new AppModel();
64
             initialization();
69
             initialization();
65
             Screenshot();
70
             Screenshot();
102
             DataContext = new AppModel();
107
             DataContext = new AppModel();
103
             WpfHelper.MainDispatcher = Dispatcher;
108
             WpfHelper.MainDispatcher = Dispatcher;
104
         }
109
         }
110
+        /// <summary>
111
+        /// 初始化快捷键
112
+        /// </summary>
113
+        public void InitializeKeyDownEvent()
114
+        {
115
+          
116
+            k_hook.Start();//安装键盘钩子
117
+        }
118
+        /// <summary>
119
+        /// 快捷键
120
+        /// </summary>
121
+        /// <param name="sender"></param>
122
+        /// <param name="e"></param>
123
+        private void K_hook_KeyDownEvent(object sender, System.Windows.Forms.KeyEventArgs e)
124
+        {
125
+            if (e.KeyValue == (int)System.Windows.Forms.Keys.Escape)
126
+            {
127
+                k_hook.Stop();
128
+                Current.OnCancel();
129
+                APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
130
+                this.Hide();
131
+            }
132
+        }
105
 
133
 
106
         #region 属性 Current
134
         #region 属性 Current
107
 
135
 
295
             //this.Hide();
323
             //this.Hide();
296
             if (ChangeTextEvent != null)
324
             if (ChangeTextEvent != null)
297
             {
325
             {
326
+                k_hook.Stop();
298
                 ChangeTextEvent("关闭窗口");
327
                 ChangeTextEvent("关闭窗口");
299
             }
328
             }
300
         }
329
         }

+ 2
- 2
XHWK.WKTool/Properties/AssemblyInfo.cs View File

49
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
49
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
50
 //通过使用 "*",如下所示:
50
 //通过使用 "*",如下所示:
51
 // [assembly: AssemblyVersion("1.0.*")]
51
 // [assembly: AssemblyVersion("1.0.*")]
52
-[assembly: AssemblyVersion("1.2.2.0")]
53
-[assembly: AssemblyFileVersion("1.2.2.0")]
52
+[assembly: AssemblyVersion("1.2.3.0")]
53
+[assembly: AssemblyFileVersion("1.2.3.0")]

+ 6
- 2
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs View File

107
             gridThickness.Visibility = Visibility.Hidden;
107
             gridThickness.Visibility = Visibility.Hidden;
108
             ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar26.png"));//大圆圈三角形
108
             ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar26.png"));//大圆圈三角形
109
             ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar15.png"));
109
             ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar15.png"));
110
+            imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar29.png"));
111
+            btnReturn.IsEnabled = true;//返回主界面可点击
110
             BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
112
             BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
111
             imgBlackPenOne.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
113
             imgBlackPenOne.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
112
             btnBlackPenOne.IsEnabled = false;//蓝笔不可点击
114
             btnBlackPenOne.IsEnabled = false;//蓝笔不可点击
349
                 txbTime.Visibility = Visibility.Visible;//时间显示
351
                 txbTime.Visibility = Visibility.Visible;//时间显示
350
                 imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar30.png"));
352
                 imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar30.png"));
351
                 //borOne.Background = new SolidColorBrush(Colors.LightBlue);
353
                 //borOne.Background = new SolidColorBrush(Colors.LightBlue);
352
-                //btnReturn.IsEnabled = false;//返回主界面可点击
354
+                btnReturn.IsEnabled = false;//返回主界面可点击
353
 
355
 
354
                 try
356
                 try
355
                 {
357
                 {
407
                 //btnBlackPenTwo.IsEnabled = false;//红笔不可点击
409
                 //btnBlackPenTwo.IsEnabled = false;//红笔不可点击
408
                 txbTime.Visibility = Visibility.Hidden;//时间不显示
410
                 txbTime.Visibility = Visibility.Hidden;//时间不显示
409
                 imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar29.png"));
411
                 imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar29.png"));
410
-                //btnReturn.IsEnabled = true;//返回主界面可点击
412
+                btnReturn.IsEnabled = true;//返回主界面可点击
411
                 #region 2秒内不可点击
413
                 #region 2秒内不可点击
412
                 new Thread(new ThreadStart(new Action(() =>
414
                 new Thread(new ThreadStart(new Action(() =>
413
                 {
415
                 {
466
             {
468
             {
467
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
469
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
468
             }
470
             }
471
+            APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
469
             APP.W_XHMicroLessonSystemWindow.Show();
472
             APP.W_XHMicroLessonSystemWindow.Show();
470
             if (!IsFirstRS)
473
             if (!IsFirstRS)
471
             {
474
             {
995
                     LogHelper.WriteErrLog("【录屏返回】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
998
                     LogHelper.WriteErrLog("【录屏返回】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
996
                 }
999
                 }
997
             }
1000
             }
1001
+            APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
998
             APP.W_XHMicroLessonSystemWindow.Show();
1002
             APP.W_XHMicroLessonSystemWindow.Show();
999
             Hide();
1003
             Hide();
1000
         }
1004
         }

+ 1
- 1
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

319
                                         </ScrollViewer>-->
319
                                         </ScrollViewer>-->
320
                                     <!--图片表框 -->
320
                                     <!--图片表框 -->
321
                                     <Rectangle x:Name="RectImgBorder" Cursor="SizeAll" Fill="#00000000" HorizontalAlignment="Left" Stroke="#2D8CF0" VerticalAlignment="Top" Width="300" Height="300" Visibility="Hidden" Margin="373,175,0,0" StrokeThickness="4" StrokeDashArray="4 4" SnapsToDevicePixels="True"/>
321
                                     <Rectangle x:Name="RectImgBorder" Cursor="SizeAll" Fill="#00000000" HorizontalAlignment="Left" Stroke="#2D8CF0" VerticalAlignment="Top" Width="300" Height="300" Visibility="Hidden" Margin="373,175,0,0" StrokeThickness="4" StrokeDashArray="4 4" SnapsToDevicePixels="True"/>
322
-                                    <Image Name="imgCanvas" Height="0" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Fill" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}" MouseRightButtonDown="imgCanvas_MouseRightButtonDown" MouseLeftButtonDown="imgCanvas_MouseLeftButtonDown" Focusable="True" MouseMove="imgCanvas_MouseMove" MouseUp="imgCanvas_MouseUp"/>
322
+                                    <Image Name="imgCanvas" Height="0" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Fill" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}" MouseLeftButtonDown="imgCanvas_MouseLeftButtonDown" Focusable="True" MouseMove="imgCanvas_MouseMove" MouseUp="imgCanvas_MouseUp"/>
323
                                     <!--四个点 -->
323
                                     <!--四个点 -->
324
                                     <Canvas>
324
                                     <Canvas>
325
                                         <Thumb x:Name="RectLeftUp" Cursor="SizeNWSE"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="314" Canvas.Top="157" Background="White" BorderBrush="#2D8CF0" BorderThickness="2"  DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>
325
                                         <Thumb x:Name="RectLeftUp" Cursor="SizeNWSE"  HorizontalAlignment="Left" Height="20"  VerticalAlignment="Top" Width="20" Visibility="Hidden" Canvas.Left="314" Canvas.Top="157" Background="White" BorderBrush="#2D8CF0" BorderThickness="2"  DragDelta="RectRightUp_DragDelta" DragStarted="RectRightUp_DragStarted" DragCompleted="RectRightUp_DragCompleted"/>

+ 26
- 10
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

176
             txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoSavePath");
176
             txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoSavePath");
177
             Initialize();
177
             Initialize();
178
             InitPen();
178
             InitPen();
179
+            k_hook = new KeyboardHookCommon();
180
+            k_hook.KeyDownEvent += K_hook_KeyDownEvent;
179
         }
181
         }
180
         /// <summary>
182
         /// <summary>
181
         /// 初始化
183
         /// 初始化
207
             //wfhCamera.Visibility = Visibility.Hidden;
209
             //wfhCamera.Visibility = Visibility.Hidden;
208
             ImgPDFPath = null;
210
             ImgPDFPath = null;
209
             ImgPDFPath = new string[300];
211
             ImgPDFPath = new string[300];
210
-
212
+        } 
213
+        /// <summary>
214
+        /// 初始化快捷键
215
+        /// </summary>
216
+        public void InitializeKeyDownEvent() 
217
+        {
218
+            k_hook.Start();//安装键盘钩子
211
         }
219
         }
212
         /// <summary>
220
         /// <summary>
213
         /// 快捷键
221
         /// 快捷键
232
                     next_btn_Click(null, null);
240
                     next_btn_Click(null, null);
233
                 }
241
                 }
234
             }
242
             }
235
-            //if (e.KeyValue == (int)System.Windows.Forms.Keys.Delete)
236
-            //{
237
-            //    if (APP.pageData.currpage < APP.pageData.pagenum)
238
-            //    {
239
-            //        //下一页
240
-            //        next_btn_Click(null, null);
241
-            //    }
242
-            //}
243
+            if (e.KeyValue == (int)System.Windows.Forms.Keys.Delete)
244
+            {
245
+                if (RectImgBorder.Visibility != Visibility.Hidden)
246
+                {
247
+                    HideAngleBorder();
248
+                    imgCanvas.Source = null;
249
+                    APP.PageDrawList[APP.pageData.currpage - 1].PdfImagePath = null;
250
+                    APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath = null;
251
+                }
252
+            }
243
         }
253
         }
244
 
254
 
245
         /// <summary>
255
         /// <summary>
902
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
912
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
903
             APP.ImgPath = desktopPath;
913
             APP.ImgPath = desktopPath;
904
             ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath, false, out BitmapImage bitmap);
914
             ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath, false, out BitmapImage bitmap);
915
+            k_hook.Stop();
905
             if (WindowState == WindowState.Normal)//截图隐藏窗口
916
             if (WindowState == WindowState.Normal)//截图隐藏窗口
906
             {
917
             {
907
                 WindowState = WindowState.Minimized;
918
                 WindowState = WindowState.Minimized;
908
             }
919
             }
920
+       
909
             if (APP.W_JieTuWindow != null)
921
             if (APP.W_JieTuWindow != null)
910
             {
922
             {
911
                 APP.W_JieTuWindow.initialization();
923
                 APP.W_JieTuWindow.initialization();
912
                 APP.W_JieTuWindow.Screenshot();
924
                 APP.W_JieTuWindow.Screenshot();
925
+                APP.W_JieTuWindow.InitializeKeyDownEvent();
913
                 APP.W_JieTuWindow.WindowState = WindowState.Maximized;
926
                 APP.W_JieTuWindow.WindowState = WindowState.Maximized;
914
                 APP.W_JieTuWindow.Visibility = Visibility.Visible;
927
                 APP.W_JieTuWindow.Visibility = Visibility.Visible;
915
             }
928
             }
916
             else
929
             else
917
             {
930
             {
918
                 APP.W_JieTuWindow = new JieTuWindow();
931
                 APP.W_JieTuWindow = new JieTuWindow();
932
+                APP.W_JieTuWindow.InitializeKeyDownEvent();
919
                 // 订阅事件
933
                 // 订阅事件
920
                 APP.W_JieTuWindow.ChangeTextEvent += new ChangeTextHandler(frm_ChangeTextEvent);
934
                 APP.W_JieTuWindow.ChangeTextEvent += new ChangeTextHandler(frm_ChangeTextEvent);
921
                 APP.W_JieTuWindow.click_closeJietuWindowClick += JietuWindow_click_closeJietuWindowClick;
935
                 APP.W_JieTuWindow.click_closeJietuWindowClick += JietuWindow_click_closeJietuWindowClick;
937
                     Topmost = true;
951
                     Topmost = true;
938
                     WindowState = WindowState.Normal;
952
                     WindowState = WindowState.Normal;
939
                 }
953
                 }
954
+                InitializeKeyDownEvent();
940
                 if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
955
                 if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
941
                 {
956
                 {
942
                     if (APP.pageData.currpage == 0)
957
                     if (APP.pageData.currpage == 0)
2629
             //        return;
2644
             //        return;
2630
             //    }
2645
             //    }
2631
             //}
2646
             //}
2632
-            #endregion   
2647
+            #endregion
2648
+            k_hook.Stop();
2633
             if (APP.W_ScreenRecordingToolbarWindow == null)
2649
             if (APP.W_ScreenRecordingToolbarWindow == null)
2634
             {
2650
             {
2635
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
2651
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow

Loading…
Cancel
Save