Explorar el Código

测试 1.2.3(Build 24)

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

+ 2
- 2
XHWK.WKTool/App.config Ver fichero

@@ -33,8 +33,8 @@
33 33
     <!--上传每片大小 Mb-->
34 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 38
     <add key="ClientSettingsProvider.ServiceUri" value="" />
39 39
   </appSettings>
40 40
   <system.web>

+ 30
- 1
XHWK.WKTool/JieTuWindow.xaml.cs Ver fichero

@@ -50,7 +50,10 @@ namespace ComeCapture
50 50
 
51 51
         private double _X0 = 0;
52 52
         private double _Y0 = 0;
53
-
53
+        /// <summary>
54
+        /// 键盘钩子
55
+        /// </summary>
56
+        private KeyboardHookCommon k_hook;
54 57
         //private IntPtr BitmapPtr = IntPtr.Zero;
55 58
         //private IntPtr JieTuBitmapPtr = IntPtr.Zero;
56 59
         /// <summary>
@@ -60,6 +63,8 @@ namespace ComeCapture
60 63
         {
61 64
             _Current = this;
62 65
             InitializeComponent();
66
+            k_hook = new KeyboardHookCommon();
67
+            k_hook.KeyDownEvent += K_hook_KeyDownEvent;
63 68
             DataContext = new AppModel();
64 69
             initialization();
65 70
             Screenshot();
@@ -102,6 +107,29 @@ namespace ComeCapture
102 107
             DataContext = new AppModel();
103 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 134
         #region 属性 Current
107 135
 
@@ -295,6 +323,7 @@ namespace ComeCapture
295 323
             //this.Hide();
296 324
             if (ChangeTextEvent != null)
297 325
             {
326
+                k_hook.Stop();
298 327
                 ChangeTextEvent("关闭窗口");
299 328
             }
300 329
         }

+ 2
- 2
XHWK.WKTool/Properties/AssemblyInfo.cs Ver fichero

@@ -49,5 +49,5 @@ using System.Windows;
49 49
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
50 50
 //通过使用 "*",如下所示:
51 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 Ver fichero

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

+ 1
- 1
XHWK.WKTool/XHMicroLessonSystemWindow.xaml Ver fichero

@@ -319,7 +319,7 @@
319 319
                                         </ScrollViewer>-->
320 320
                                     <!--图片表框 -->
321 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 324
                                     <Canvas>
325 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 Ver fichero

@@ -176,6 +176,8 @@ namespace XHWK.WKTool
176 176
             txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoSavePath");
177 177
             Initialize();
178 178
             InitPen();
179
+            k_hook = new KeyboardHookCommon();
180
+            k_hook.KeyDownEvent += K_hook_KeyDownEvent;
179 181
         }
180 182
         /// <summary>
181 183
         /// 初始化
@@ -207,7 +209,13 @@ namespace XHWK.WKTool
207 209
             //wfhCamera.Visibility = Visibility.Hidden;
208 210
             ImgPDFPath = null;
209 211
             ImgPDFPath = new string[300];
210
-
212
+        } 
213
+        /// <summary>
214
+        /// 初始化快捷键
215
+        /// </summary>
216
+        public void InitializeKeyDownEvent() 
217
+        {
218
+            k_hook.Start();//安装键盘钩子
211 219
         }
212 220
         /// <summary>
213 221
         /// 快捷键
@@ -232,14 +240,16 @@ namespace XHWK.WKTool
232 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 255
         /// <summary>
@@ -902,20 +912,24 @@ namespace XHWK.WKTool
902 912
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
903 913
             APP.ImgPath = desktopPath;
904 914
             ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath, false, out BitmapImage bitmap);
915
+            k_hook.Stop();
905 916
             if (WindowState == WindowState.Normal)//截图隐藏窗口
906 917
             {
907 918
                 WindowState = WindowState.Minimized;
908 919
             }
920
+       
909 921
             if (APP.W_JieTuWindow != null)
910 922
             {
911 923
                 APP.W_JieTuWindow.initialization();
912 924
                 APP.W_JieTuWindow.Screenshot();
925
+                APP.W_JieTuWindow.InitializeKeyDownEvent();
913 926
                 APP.W_JieTuWindow.WindowState = WindowState.Maximized;
914 927
                 APP.W_JieTuWindow.Visibility = Visibility.Visible;
915 928
             }
916 929
             else
917 930
             {
918 931
                 APP.W_JieTuWindow = new JieTuWindow();
932
+                APP.W_JieTuWindow.InitializeKeyDownEvent();
919 933
                 // 订阅事件
920 934
                 APP.W_JieTuWindow.ChangeTextEvent += new ChangeTextHandler(frm_ChangeTextEvent);
921 935
                 APP.W_JieTuWindow.click_closeJietuWindowClick += JietuWindow_click_closeJietuWindowClick;
@@ -937,6 +951,7 @@ namespace XHWK.WKTool
937 951
                     Topmost = true;
938 952
                     WindowState = WindowState.Normal;
939 953
                 }
954
+                InitializeKeyDownEvent();
940 955
                 if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
941 956
                 {
942 957
                     if (APP.pageData.currpage == 0)
@@ -2629,7 +2644,8 @@ namespace XHWK.WKTool
2629 2644
             //        return;
2630 2645
             //    }
2631 2646
             //}
2632
-            #endregion   
2647
+            #endregion
2648
+            k_hook.Stop();
2633 2649
             if (APP.W_ScreenRecordingToolbarWindow == null)
2634 2650
             {
2635 2651
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow

Loading…
Cancelar
Guardar