Browse Source

zhao:1修改登录窗口title有白边 2解决录屏和录制过快而无法录制 3修改录屏退出不保存视频 4主页面增加退出系统提示 5我的页面倒序排列

tags/录制修改前
耀 4 years ago
parent
commit
61e430d536

+ 50
- 51
XHWK.WKTool/LoginWindow.xaml View File

@@ -12,63 +12,62 @@
12 12
     <Window.Effect>
13 13
         <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
14 14
     </Window.Effect>
15
-    <Viewbox>
16
-        <Grid Height="358" Width="471" Background="#FFFFFF">
17
-            <!--分5行-->
18
-            <Grid.RowDefinitions>
19
-                <RowDefinition Height="45"/>
20
-                <RowDefinition Height="70"/>
21
-                <RowDefinition Height="70"/>
22
-                <RowDefinition Height="50"/>
23
-                <RowDefinition Height="*"/>
24
-            </Grid.RowDefinitions>
25
-            <!--第一行 标题-->
26
-            <Border Grid.Row="0" Background="#2D8CF0">
27
-                <Grid>
28
-                    <TextBlock Text="登录星火微课系统" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
29
-                    <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>
30
-                </Grid>
15
+
16
+    <Grid Background="#FFFFFF">
17
+        <!--分5行-->
18
+        <Grid.RowDefinitions>
19
+            <RowDefinition Height="45"/>
20
+            <RowDefinition Height="70"/>
21
+            <RowDefinition Height="70"/>
22
+            <RowDefinition Height="50"/>
23
+            <RowDefinition Height="*"/>
24
+        </Grid.RowDefinitions>
25
+        <!--第一行 标题-->
26
+        <Border Grid.Row="0" Background="#2D8CF0">
27
+            <Grid>
28
+                <TextBlock Text="登录星火微课系统" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
29
+                <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>
30
+            </Grid>
31
+        </Border>
32
+        <!--第二行 登陆 账号-->
33
+        <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="20,20,0,0">
34
+            <TextBlock Text="登陆" FontSize="18" Padding="2,15,10,0"/>
35
+            <!--输入框-->
36
+            <Border Background="#cccbce" Width="371" Height="43" CornerRadius="3">
37
+                <TextBox x:Name="txbAccountNumber" Text="" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="369" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
38
+            </Border>
39
+        </StackPanel>
40
+        <!--第三行 密码-->
41
+        <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="20,20,0,0">
42
+            <TextBlock Text="密码" FontSize="18" Padding="2,15,10,0"/>
43
+            <!--输入框-->
44
+            <Border Background="#cccbce" Width="371" Height="43" CornerRadius="3">
45
+                <PasswordBox x:Name="pobPassword" FontSize="16" Foreground="#333333" PasswordChar="*" Padding="5,12,2,2" Width="369" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
31 46
             </Border>
32
-            <!--第二行 登陆 账号-->
33
-            <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="20,20,0,0">
34
-                <TextBlock Text="登陆" FontSize="18" Padding="2,15,10,0"/>
35
-                <!--输入框-->
36
-                <Border Background="#cccbce" Width="371" Height="43" CornerRadius="3">
37
-                    <TextBox x:Name="txbAccountNumber" Text="" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="369" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
38
-                </Border>
39
-            </StackPanel>
40
-            <!--第三行 密码-->
41
-            <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="20,20,0,0">
42
-                <TextBlock Text="密码" FontSize="18" Padding="2,15,10,0"/>
43
-                <!--输入框-->
44
-                <Border Background="#cccbce" Width="371" Height="43" CornerRadius="3">
45
-                    <PasswordBox x:Name="pobPassword" FontSize="16" Foreground="#333333" PasswordChar="*" Padding="5,12,2,2" Width="369" Height="41" BorderBrush="{x:Null}" BorderThickness="0"/>
46
-                </Border>
47
-            </StackPanel>
48
-            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="20,10,0,0">
49
-                <Viewbox Height="23">
50
-                    <CheckBox   x:Name="ckSaveName" Click="CkSaveName_Click"/>
51
-                </Viewbox>
52
-                <TextBlock Text="记住账号" FontSize="18" Height="30" Padding="5,3,0,0"/>
53
-            </StackPanel>
47
+        </StackPanel>
48
+        <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="20,10,0,0">
49
+            <Viewbox Height="23">
50
+                <CheckBox   x:Name="ckSaveName" Click="CkSaveName_Click"/>
51
+            </Viewbox>
52
+            <TextBlock Text="记住账号" FontSize="18" Height="30" Padding="5,3,0,0" Margin="0,9,0,1"/>
53
+        </StackPanel>
54 54
 
55
-            <!--第五行 开始按钮-->
56
-            <Button  Cursor="Hand" Grid.Row="4" x:Name="btnStart" Content="登录" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="418" Height="50" Margin="10,0,10,0" Click="BtnStart_Click">
57
-                <Button.Template>
58
-                    <ControlTemplate TargetType="{x:Type Button}">
59
-                        <Border
55
+        <!--第五行 开始按钮-->
56
+        <Button  Cursor="Hand" Grid.Row="4" x:Name="btnStart" Content="登录" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="418" Height="50" Margin="10,0,10,0" Click="BtnStart_Click">
57
+            <Button.Template>
58
+                <ControlTemplate TargetType="{x:Type Button}">
59
+                    <Border
60 60
                                 BorderBrush="{TemplateBinding Control.BorderBrush}"
61 61
                                 BorderThickness="1"
62 62
                                 CornerRadius="7">
63
-                            <Border.Background>#2D8CF0</Border.Background>
64
-                            <ContentPresenter
63
+                        <Border.Background>#2D8CF0</Border.Background>
64
+                        <ContentPresenter
65 65
                                     HorizontalAlignment="Center"
66 66
                                     VerticalAlignment="Center"
67 67
                                     Content="{TemplateBinding ContentControl.Content}" />
68
-                        </Border>
69
-                    </ControlTemplate>
70
-                </Button.Template>
71
-            </Button>
72
-        </Grid>
73
-    </Viewbox>
68
+                    </Border>
69
+                </ControlTemplate>
70
+            </Button.Template>
71
+        </Button>
72
+    </Grid>
74 73
 </Window>

+ 42
- 47
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs View File

@@ -343,9 +343,27 @@ namespace XHWK.WKTool
343 343
                 btnBlackPenTwo.IsEnabled = true;//红笔可点击
344 344
                 txbTime.Visibility = Visibility.Visible;//时间显示
345 345
                 imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar30.png"));
346
-                btnReturn.IsEnabled = false;//返回主界面可点击
346
+                //btnReturn.IsEnabled = false;//返回主界面可点击
347 347
                 try
348 348
                 {
349
+                    #region 4秒内不可点击
350
+                    new Thread(new ThreadStart(new Action(() =>
351
+                    {
352
+                        Dispatcher.Invoke(() =>
353
+                        {
354
+                            ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar15.png"));
355
+                            BtnRecordingScreen.IsEnabled = false;
356
+                            BtnStopRecordingScreen.IsEnabled = false;
357
+                        });
358
+                        Thread.Sleep(4000);
359
+                        Dispatcher.Invoke(() =>
360
+                        {
361
+                            ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar14.png"));
362
+                            BtnRecordingScreen.IsEnabled = true;
363
+                            BtnStopRecordingScreen.IsEnabled = true;
364
+                        });
365
+                    }))).Start();
366
+                    #endregion
349 367
                     new Thread(new ThreadStart(new Action(() =>
350 368
                     {
351 369
                         if (IsFirstRS)
@@ -375,7 +393,6 @@ namespace XHWK.WKTool
375 393
                 TimeOut();
376 394
                 IsSuspend = true;
377 395
                 ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar26.png"));//大圆圈三角形
378
-                ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar15.png"));
379 396
                 BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
380 397
                 imgBlackPenOne.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
381 398
                 btnBlackPenOne.IsEnabled = false;//蓝笔不可点击
@@ -383,12 +400,13 @@ namespace XHWK.WKTool
383 400
                 btnBlackPenTwo.IsEnabled = false;//红笔不可点击
384 401
                 txbTime.Visibility = Visibility.Hidden;//时间不显示
385 402
                 imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar29.png"));
386
-                btnReturn.IsEnabled = true;//返回主界面可点击
403
+                //btnReturn.IsEnabled = true;//返回主界面可点击
387 404
                 #region 2秒内不可点击
388 405
                 new Thread(new ThreadStart(new Action(() =>
389 406
                 {
390 407
                     Dispatcher.Invoke(() =>
391 408
                     {
409
+                        ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar15.png"));
392 410
                         BtnRecordingScreen.IsEnabled = false;
393 411
                         BtnStopRecordingScreen.IsEnabled = false;
394 412
                     });
@@ -882,60 +900,36 @@ namespace XHWK.WKTool
882 900
         /// <param name="e"></param>
883 901
         private void BtnReturn_Click(object sender, RoutedEventArgs e)
884 902
         {
885
-            MessageBoxResult br=MessageWindow.Show("退出将不保存当前录屏!", "提示", MessageBoxButton.OKCancel);
886
-            if(br==MessageBoxResult.Cancel)
887
-            {
888
-                return;
889
-            }
890
-            k_hook.Stop();
891
-            IsSuspend = true;
892
-            txbTime.Text = "00:00";
893
-
894
-            txbTime.Visibility = Visibility.Hidden;
895
-            End();
896
-            if (APP.W_PracticeWindow != null)
903
+            if (!IsFirstRS)
897 904
             {
898
-                if (APP.W_PracticeWindow.Visibility == Visibility.Visible)
905
+                MessageBoxResult br = MessageWindow.Show("退出将不保存当前录屏!", "提示", MessageBoxButton.OKCancel);
906
+                if (br == MessageBoxResult.Cancel)
899 907
                 {
900
-                    APP.W_PracticeWindow.Hide();
908
+                    return;
901 909
                 }
902
-            }
903
-            if (gridToolbar.Visibility == Visibility.Visible)
904
-            {
905
-                gridToolbar.Visibility = Visibility.Hidden;
906
-                gridColour.Visibility = Visibility.Hidden;
907
-                gridThickness.Visibility = Visibility.Hidden;
908
-            }
909
-            if (APP.W_XHMicroLessonSystemWindow == null)
910
-            {
911
-                MessageBoxResult dr = MessageWindow.Show("返回主界面视频不保存,是否返回?", "提示", MessageBoxButton.OKCancel);
912
-                if (dr == MessageBoxResult.OK)
913
-                {
914
-                    IsSuspend = true;
915
-                    txbTime.Text = "00:00";
910
+                k_hook.Stop();
911
+                IsSuspend = true;
912
+                txbTime.Text = "00:00";
916 913
 
917
-                    txbTime.Visibility = Visibility.Hidden;
918
-                    End();
919
-                    if (APP.W_XHMicroLessonSystemWindow == null)
914
+                txbTime.Visibility = Visibility.Hidden;
915
+                End();
916
+                if (APP.W_PracticeWindow != null)
917
+                {
918
+                    if (APP.W_PracticeWindow.Visibility == Visibility.Visible)
920 919
                     {
921
-                        APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
920
+                        APP.W_PracticeWindow.Hide();
922 921
                     }
923
-                    APP.W_XHMicroLessonSystemWindow.Show();
924
-                    Hide();
925 922
                 }
926
-            }
927
-            else
928
-            {
923
+                if (gridToolbar.Visibility == Visibility.Visible)
924
+                {
925
+                    gridToolbar.Visibility = Visibility.Hidden;
926
+                    gridColour.Visibility = Visibility.Hidden;
927
+                    gridThickness.Visibility = Visibility.Hidden;
928
+                }
929 929
                 if (APP.W_XHMicroLessonSystemWindow == null)
930 930
                 {
931 931
                     APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
932 932
                 }
933
-                APP.W_XHMicroLessonSystemWindow.Show();
934
-                Hide();
935
-            }
936
-            APP.W_XHMicroLessonSystemWindow.Show();
937
-            if (!IsFirstRS)
938
-            {
939 933
                 try
940 934
                 {
941 935
                     try
@@ -951,7 +945,7 @@ namespace XHWK.WKTool
951 945
                     {
952 946
                         VideoInfo = null;
953 947
                         FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temprs/");
954
-                        
948
+
955 949
                     }))).Start();
956 950
                 }
957 951
                 catch (Exception ex)
@@ -959,6 +953,7 @@ namespace XHWK.WKTool
959 953
                     LogHelper.WriteErrLog("【录屏返回】(BtnStopRecordingScreen_Click)" + ex.Message, ex);
960 954
                 }
961 955
             }
956
+            APP.W_XHMicroLessonSystemWindow.Show();
962 957
             Hide();
963 958
         }
964 959
     }

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

@@ -260,8 +260,8 @@
260 260
                     </Button>-->
261 261
                 <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,30,0" Click="BtnUpload_Click">
262 262
                     <StackPanel Orientation="Vertical">
263
-                        <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_22.png" Visibility="Collapsed"/>
264
-                        <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_1.png" Visibility="Visible"/>
263
+                        <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_22.png" Visibility="Visible"/>
264
+                        <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_1.png" Visibility="Collapsed"/>
265 265
                         <TextBlock Text="我的" FontSize="14" Padding="0,6,0,0" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
266 266
                     </StackPanel>
267 267
                 </Button>

+ 28
- 22
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

@@ -423,11 +423,15 @@ namespace XHWK.WKTool
423 423
         {
424 424
             if (IsFirstR)
425 425
             {
426
-                APP.Killffmpeg();
427
-                APP.SaveWkData();
428
-                APP.SaveDraw();
429
-                Thread.Sleep(100);
430
-                System.Environment.Exit(0);
426
+                MessageBoxResult br= MessageWindow.Show("确定退出系统?","退出",MessageBoxButton.OKCancel);
427
+                if (br == MessageBoxResult.OK)
428
+                {
429
+                    APP.Killffmpeg();
430
+                    APP.SaveWkData();
431
+                    APP.SaveDraw();
432
+                    Thread.Sleep(100);
433
+                    System.Environment.Exit(0);
434
+                }
431 435
             }
432 436
             else
433 437
             {
@@ -1482,6 +1486,11 @@ namespace XHWK.WKTool
1482 1486
                     }
1483 1487
                     #endregion
1484 1488
                 }
1489
+                //翻转
1490
+                if(model_VideoList.Count>1)
1491
+                {
1492
+                    model_VideoList.Reverse();
1493
+                }
1485 1494
             }
1486 1495
             catch (Exception ex)
1487 1496
             {
@@ -2306,22 +2315,27 @@ namespace XHWK.WKTool
2306 2315
                 IsSuspendR = false;
2307 2316
                 //BtnRecording.Content = "暂停录制";
2308 2317
                 ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_23.png"));
2309
-                ImgStop.Visibility = Visibility.Collapsed;
2310
-                ImgStopTwo.Visibility = Visibility.Visible;
2311 2318
                 TxbRecordingWord.Text = "暂停";
2312
-                #region 2秒内不可点击
2319
+                #region 4秒内不可点击
2313 2320
                 new Thread(new ThreadStart(new Action(() =>
2314 2321
                 {
2315 2322
                     Dispatcher.Invoke(() =>
2316 2323
                     {
2317 2324
                         BtnRecord.IsEnabled = false;
2318 2325
                         btnStop.IsEnabled = false;
2326
+                        ImgStop.Visibility = Visibility.Visible;
2327
+                        ImgStopTwo.Visibility = Visibility.Collapsed;
2319 2328
                     });
2320
-                    Thread.Sleep(2000);
2329
+                }))).Start();
2330
+                new Thread(new ThreadStart(new Action(() =>
2331
+                {
2332
+                    Thread.Sleep(4000);
2321 2333
                     Dispatcher.Invoke(() =>
2322 2334
                     {
2323 2335
                         BtnRecord.IsEnabled = true;
2324 2336
                         btnStop.IsEnabled = true;
2337
+                        ImgStop.Visibility = Visibility.Collapsed;
2338
+                        ImgStopTwo.Visibility = Visibility.Visible;
2325 2339
                     });
2326 2340
                 }))).Start();
2327 2341
                 #endregion
@@ -2624,8 +2638,11 @@ namespace XHWK.WKTool
2624 2638
                         if (ThuRes)
2625 2639
                         {
2626 2640
                             Bitmap bmp = ImageHelper.ReadBitmapFile(ThumbnailPathName);
2627
-                            imgW = bmp.Width + (bmp.Width % 2 > 0 ? 1 : 0);
2628
-                            imgH = bmp.Height + (bmp.Height % 2 > 0 ? 1 : 0);
2641
+                            if (bmp != null)
2642
+                            {
2643
+                                imgW = bmp.Width + (bmp.Width % 2 > 0 ? 1 : 0);
2644
+                                imgH = bmp.Height + (bmp.Height % 2 > 0 ? 1 : 0);
2645
+                            }
2629 2646
                         }
2630 2647
 
2631 2648
                         APP.FFmpeg.VideoTranscode(VideoSynthesisPathName, VideoSavePathName, imgW, imgH);
@@ -4189,16 +4206,5 @@ namespace XHWK.WKTool
4189 4206
         {
4190 4207
             HideAngleBorder();
4191 4208
         }
4192
-
4193
-        private void Button_Click_1(object sender, RoutedEventArgs e)
4194
-        {
4195
-            Thread.Sleep(2000);
4196
-        }
4197
-
4198
-        private void Button_Click_2(object sender, RoutedEventArgs e)
4199
-        {
4200
-            
4201
-            MessageWindow.Show("A:"+ActualWidth*(PrimaryScreen.DpiX / 96f)+"x" +ActualHeight * (PrimaryScreen.DpiY / 96f) + "  wh:"+Width+"x"+Height);
4202
-        }
4203 4209
     }
4204 4210
 }

Loading…
Cancel
Save