Browse Source

Merge remote-tracking branch 'origin/zhangxueyang' into zyy

tags/录制修改前
耀 3 years ago
parent
commit
72f07d7e6a

+ 75
- 8
XHWK.WKTool/PracticeWindow.xaml.cs View File

22
     {
22
     {
23
         //声明一个 DrawingAttributes 类型的变量  
23
         //声明一个 DrawingAttributes 类型的变量  
24
         private DrawingAttributes drawingAttributes;
24
         private DrawingAttributes drawingAttributes;
25
-
25
+        private DrawingAttributes drawing;
26
         private ViewModel viewModel;
26
         private ViewModel viewModel;
27
         /// <summary>
27
         /// <summary>
28
         /// 0 画笔 1 矩形 2 圆形 
28
         /// 0 画笔 1 矩形 2 圆形 
108
         /// <param name="e"></param>
108
         /// <param name="e"></param>
109
         public void Red()
109
         public void Red()
110
         {
110
         {
111
-            //flg = 0;
112
-            //设置 DrawingAttributes 的 Color 属性设置颜色  
113
-            drawingAttributes.Color = Colors.Red;
111
+                drawingAttributes.Color = Colors.Red;
114
             Colour = Colors.Red;
112
             Colour = Colors.Red;
115
         }
113
         }
116
         /// <summary>
114
         /// <summary>
562
             //}
560
             //}
563
 
561
 
564
 
562
 
563
+                if (strokes != null && strokes.StylusPoints.Count > 1)
564
+                {
565
+                    isFirst = true;
566
+                }
567
+                stylusPoints = new StylusPointCollection();
568
+                stylusPoint = new StylusPoint();
569
+                strokes = null;
565
         }
570
         }
566
 
571
 
567
         /// <summary>
572
         /// <summary>
694
                 double testX = cy * PropW;
699
                 double testX = cy * PropW;
695
                 double testY = (A4_WIDTH - cx) * PropH;
700
                 double testY = (A4_WIDTH - cx) * PropH;
696
                 //pageSerial //点阵IP地址  与打印的页面关联
701
                 //pageSerial //点阵IP地址  与打印的页面关联
697
-                if (APP.pageData.currpage > 0)
702
+                if (true)
698
                 {
703
                 {
699
                     Dispatcher.Invoke(new Action(() =>
704
                     Dispatcher.Invoke(new Action(() =>
700
                     {
705
                     {
701
                         float Pressure = force / 100f;
706
                         float Pressure = force / 100f;
702
-                        //添加笔画
707
+                        ////添加笔画
703
                         //myblackboard.changepages(testX, testY, false, Color, PenSize, APP.pageData.currpage - 1, Pressure);
708
                         //myblackboard.changepages(testX, testY, false, Color, PenSize, APP.pageData.currpage - 1, Pressure);
704
 
709
 
710
+                        if (isFirst)
711
+                        {
712
+                            stylusPoint.X = testX;
713
+                            stylusPoint.Y = testY;
714
+                            //_color.A = (byte)(Pressure * 255f);
715
+                            //stylusPoint.PressureFactor = Pressure;
716
+
717
+                            //for(int i=0;i<100;i++)
718
+                            //{
719
+                            //    stylusPoint.X--;
720
+                            //    stylusPoint.Y--;
721
+                            //    stylusPoints.Add(stylusPoint);
722
+                            //}
723
+                            stylusPoints.Add(stylusPoint);
724
+                            if (stylusPoints.Count > 1)
725
+                            {
726
+                                drawing = new DrawingAttributes
727
+                                {
728
+                                    Color = Colour,
729
+                                    Width = Wit * 4.5,
730
+                                    Height = Wit * 4.5,
731
+                                    FitToCurve = true,
732
+                                    IgnorePressure = false
733
+                                };
734
+                            
735
+                                //blackboard_canvas.Strokes = new StrokeCollection();
736
+                                strokes = new Stroke(stylusPoints);
737
+
738
+                             
739
+                                strokes.DrawingAttributes = drawing;
740
+                                //blackboard_canvas.Strokes.Add(strokes);
741
+
742
+                                blackboard_canvas.Strokes.Add(strokes);
743
+                                isFirst = false;
744
+                            }
745
+                        }
746
+                        else
747
+                        {
748
+                            if (blackboard_canvas.Strokes.Count>0)
749
+                            {
750
+                                stylusPoint.X = testX;
751
+                                stylusPoint.Y = testY;
752
+                                stylusPoints.Add(stylusPoint);
753
+                                strokes = new Stroke(stylusPoints);
754
+                                drawing = new DrawingAttributes
755
+                                {
756
+                                    Color = Colour,
757
+                                    Width = Wit * 4.5,
758
+                                    Height = Wit * 4.5,
759
+                                    FitToCurve = true,
760
+                                    IgnorePressure = false
761
+                                };
762
+                                strokes.DrawingAttributes = drawing;
763
+
764
+                                //viewModel.InkStrokes.Add(strokes);
765
+                                blackboard_canvas.Strokes[blackboard_canvas.Strokes.Count - 1] = strokes;
766
+                            }
767
+                        }
768
+
705
                         //设置鼠标位置
769
                         //设置鼠标位置
706
                         if (testX > 0 && testY > 0)
770
                         if (testX > 0 && testY > 0)
707
                         {
771
                         {
708
                             //System.Windows.Point getP = scroMain.PointToScreen(new System.Windows.Point(testX, testY - scroMain.VerticalOffset));
772
                             //System.Windows.Point getP = scroMain.PointToScreen(new System.Windows.Point(testX, testY - scroMain.VerticalOffset));
709
-                            SetCursorPos((int)testX, (int)testY);
773
+                            SetCursorPos((int)((float)testX* (PrimaryScreen.DpiX / 96f)), (int)((float)testY* (PrimaryScreen.DpiY / 96f)));
710
                         }
774
                         }
711
                     }));
775
                     }));
712
                 }
776
                 }
713
 
777
 
714
             }
778
             }
715
         }
779
         }
716
-
780
+        bool isFirst = true;
781
+        private StylusPointCollection stylusPoints = new StylusPointCollection();
782
+        private StylusPoint stylusPoint = new StylusPoint();
783
+        private Stroke strokes;
717
         /// <summary>
784
         /// <summary>
718
         /// 停止笔
785
         /// 停止笔
719
         /// </summary>
786
         /// </summary>

+ 26
- 16
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

377
                         <RowDefinition Height="50"/>
377
                         <RowDefinition Height="50"/>
378
                         <RowDefinition Height="50"/>
378
                         <RowDefinition Height="50"/>
379
                         <RowDefinition Height="50"/>
379
                         <RowDefinition Height="50"/>
380
+                        <RowDefinition Height="50"/>
380
                         <RowDefinition Height="*"/>
381
                         <RowDefinition Height="*"/>
381
                     </Grid.RowDefinitions>
382
                     </Grid.RowDefinitions>
382
                     <Grid.ColumnDefinitions>
383
                     <Grid.ColumnDefinitions>
394
                         <RadioButton x:Name="rbnAVI" Cursor="Hand" Style="{StaticResource radBase}" Content=" AVI" FontSize="14" Foreground="#333333" Margin="20,-26,0,0" Visibility="Collapsed"/>
395
                         <RadioButton x:Name="rbnAVI" Cursor="Hand" Style="{StaticResource radBase}" Content=" AVI" FontSize="14" Foreground="#333333" Margin="20,-26,0,0" Visibility="Collapsed"/>
395
                     </StackPanel>
396
                     </StackPanel>
396
 
397
 
397
-                    <TextBlock Grid.Row="2" Grid.Column="0" Text="摄像头位置" FontSize="16" Foreground="#333333" HorizontalAlignment="Right"/>
398
+
399
+                    <TextBlock Grid.Row="2" Grid.Column="0" Text="录屏工具栏" FontSize="16" Foreground="#333333" HorizontalAlignment="Right"/>
398
                     <StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
400
                     <StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
401
+                        <RadioButton x:Name="rbnHide"  Cursor="Hand" Style="{StaticResource radBase}" Content=" 隐藏" FontSize="14" Foreground="#333333" VerticalAlignment="Top" IsChecked="True"/>
402
+                        <RadioButton x:Name="rbnvisi" Cursor="Hand" Style="{StaticResource radBase}" Content=" 显示" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="20,0,0,0"/>
403
+                    </StackPanel>
404
+
405
+
406
+
407
+                    <TextBlock Grid.Row="3" Grid.Column="0" Text="摄像头位置" FontSize="16" Foreground="#333333" HorizontalAlignment="Right"/>
408
+                    <StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
399
                         <RadioButton Cursor="Hand" x:Name="rbnRight" Style="{StaticResource radBase}" Content=" 右上" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="0,0,0,0" IsChecked="True"/>
409
                         <RadioButton Cursor="Hand" x:Name="rbnRight" Style="{StaticResource radBase}" Content=" 右上" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="0,0,0,0" IsChecked="True"/>
400
                         <RadioButton Cursor="Hand" x:Name="rbnRightUnder" Style="{StaticResource radBase}" Content=" 右下" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="20,0,0,0"/>
410
                         <RadioButton Cursor="Hand" x:Name="rbnRightUnder" Style="{StaticResource radBase}" Content=" 右下" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="20,0,0,0"/>
401
                         <RadioButton Cursor="Hand" x:Name="rbnLeft" Style="{StaticResource radBase}" Content=" 左上" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="20,0,0,0" />
411
                         <RadioButton Cursor="Hand" x:Name="rbnLeft" Style="{StaticResource radBase}" Content=" 左上" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="20,0,0,0" />
402
                         <RadioButton Cursor="Hand" x:Name="rbnLeftUnder" Style="{StaticResource radBase}" Content=" 左下" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="20,0,0,0"/>
412
                         <RadioButton Cursor="Hand" x:Name="rbnLeftUnder" Style="{StaticResource radBase}" Content=" 左下" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="20,0,0,0"/>
403
                     </StackPanel>
413
                     </StackPanel>
404
-                    <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0" Visibility="Collapsed">
414
+                    <StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0" Visibility="Collapsed">
405
                         <TextBlock Text="视频声音" FontSize="16" Foreground="#2D8CF0" Width="80"/>
415
                         <TextBlock Text="视频声音" FontSize="16" Foreground="#2D8CF0" Width="80"/>
406
                         <RadioButton x:Name="rbnY" Cursor="Hand" Content="有" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
416
                         <RadioButton x:Name="rbnY" Cursor="Hand" Content="有" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
407
                         <RadioButton x:Name="rbnN" Cursor="Hand" Content="无" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
417
                         <RadioButton x:Name="rbnN" Cursor="Hand" Content="无" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
409
 
419
 
410
 
420
 
411
                     <!--接口地址-->
421
                     <!--接口地址-->
412
-                    <TextBlock Grid.Row="3" Grid.Column="0" Text="接口地址" FontSize="16" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0"/>
413
-                    <StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" Margin="30,0,0,0">
422
+                    <TextBlock Grid.Row="4" Grid.Column="0" Text="接口地址" FontSize="16" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0"/>
423
+                    <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" Margin="30,0,0,0">
414
                         <TextBlock Text="http://" FontSize="14" Padding="0,0,5,0"/>
424
                         <TextBlock Text="http://" FontSize="14" Padding="0,0,5,0"/>
415
                         <TextBox x:Name="txbInterfaceAddress" FontSize="14" Width="467" Height="30" Margin="0,-30,0,0"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
425
                         <TextBox x:Name="txbInterfaceAddress" FontSize="14" Width="467" Height="30" Margin="0,-30,0,0"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
416
                     </StackPanel>
426
                     </StackPanel>
417
 
427
 
418
                     <!--上传地址-->
428
                     <!--上传地址-->
419
-                    <TextBlock Grid.Row="4" Grid.Column="0" Text="上传地址" FontSize="16" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0"/>
420
-                    <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" Margin="30,0,0,0">
429
+                    <TextBlock Grid.Row="5" Grid.Column="0" Text="上传地址" FontSize="16" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0"/>
430
+                    <StackPanel Grid.Row="5" Grid.Column="1" Orientation="Horizontal" Margin="30,0,0,0">
421
                         <TextBlock Text="http://" FontSize="14" Padding="0,0,5,0"/>
431
                         <TextBlock Text="http://" FontSize="14" Padding="0,0,5,0"/>
422
                         <TextBox x:Name="txbImageUploadAddress" FontSize="14" Margin="0,-30,0,0" Width="467" Height="30"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
432
                         <TextBox x:Name="txbImageUploadAddress" FontSize="14" Margin="0,-30,0,0" Width="467" Height="30"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
423
                     </StackPanel>
433
                     </StackPanel>
424
 
434
 
425
                     <!--下载地址-->
435
                     <!--下载地址-->
426
-                    <TextBlock Grid.Row="5" Grid.Column="0" Text="下载地址" FontSize="16" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0"/>
427
-                    <StackPanel Grid.Row="5" Grid.Column="1" Orientation="Horizontal" Margin="30,0,0,0">
436
+                    <TextBlock Grid.Row="6" Grid.Column="0" Text="下载地址" FontSize="16" Foreground="#333333" HorizontalAlignment="Right" Padding="0,0,0,0"/>
437
+                    <StackPanel Grid.Row="6" Grid.Column="1" Orientation="Horizontal" Margin="30,0,0,0">
428
                         <TextBlock Text="http://" FontSize="14" Padding="0,0,5,0"/>
438
                         <TextBlock Text="http://" FontSize="14" Padding="0,0,5,0"/>
429
                         <TextBox x:Name="txbPictureShowsAddress" FontSize="14" Margin="0,-30,0,0" Width="467" Height="30"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
439
                         <TextBox x:Name="txbPictureShowsAddress" FontSize="14" Margin="0,-30,0,0" Width="467" Height="30"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
430
                     </StackPanel>
440
                     </StackPanel>
431
 
441
 
432
-                    <TextBlock Grid.Row="6" Grid.Column="0" x:Name="txbFilePath" Text="文件路径" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" Padding="0,0,0,0" />
433
-                    <StackPanel Grid.Row="6" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
442
+                    <TextBlock Grid.Row="7" Grid.Column="0" x:Name="txbFilePath" Text="文件路径" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" Padding="0,0,0,0" />
443
+                    <StackPanel Grid.Row="7" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
434
                         <Border Background="#CDD6E0" Width="515" Height="30" CornerRadius="3" Margin="0,-30,0,0">
444
                         <Border Background="#CDD6E0" Width="515" Height="30" CornerRadius="3" Margin="0,-30,0,0">
435
                             <Label x:Name="txbStoragePath" Background="#FFFFFF" Margin="0,0,0,0" Content="D:\" FontSize="14" Foreground="#333333" Padding="10,7,2,2" Width="513" Height="28" BorderBrush="{x:Null}" BorderThickness="0"/>
445
                             <Label x:Name="txbStoragePath" Background="#FFFFFF" Margin="0,0,0,0" Content="D:\" FontSize="14" Foreground="#333333" Padding="10,7,2,2" Width="513" Height="28" BorderBrush="{x:Null}" BorderThickness="0"/>
436
                         </Border>
446
                         </Border>
473
                             </Button.Template>
483
                             </Button.Template>
474
                         </Button>
484
                         </Button>
475
                     </StackPanel>
485
                     </StackPanel>
476
-                    <TextBlock Grid.Row="7" Grid.Column="0" Text="录屏快捷键" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" Margin="0,0,0,0"/>
477
-                    <StackPanel Grid.Row="7" Grid.Column="1">
486
+                    <TextBlock Grid.Row="8" Grid.Column="0" Text="录屏快捷键" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" Margin="0,0,0,0"/>
487
+                    <StackPanel Grid.Row="8" Grid.Column="1">
478
                         <TextBlock  FontSize="14" Foreground="#333333" Text="开始/暂停:Ctrl+F5     停止:Ctrl+S     退出讲评:鼠标右键" Margin="30,0,0,0"/>
488
                         <TextBlock  FontSize="14" Foreground="#333333" Text="开始/暂停:Ctrl+F5     停止:Ctrl+S     退出讲评:鼠标右键" Margin="30,0,0,0"/>
479
                     </StackPanel>
489
                     </StackPanel>
480
-                    <TextBlock Grid.Row="9" Grid.Column="0" x:Name="txbVersion" Text="正式版:" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" Margin="0,0,0,0"/>
481
-                    <StackPanel Grid.Row="9" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
490
+                    <TextBlock Grid.Row="10" Grid.Column="0" x:Name="txbVersion" Text="正式版:" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" Margin="0,0,0,0"/>
491
+                    <StackPanel Grid.Row="10" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
482
                         <TextBlock x:Name="txbv" Text="V0.0.0" FontSize="16" Foreground="#333333"/>
492
                         <TextBlock x:Name="txbv" Text="V0.0.0" FontSize="16" Foreground="#333333"/>
483
                     </StackPanel>
493
                     </StackPanel>
484
 
494
 
485
-                    <TextBlock Grid.Row="8" Grid.Column="0" Text="版权所有" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" Margin="0,0,0,0"/>
486
-                    <StackPanel Grid.Row="8" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
495
+                    <TextBlock Grid.Row="9" Grid.Column="0" Text="版权所有" FontSize="16" HorizontalAlignment="Right" Foreground="#333333" Margin="0,0,0,0"/>
496
+                    <StackPanel Grid.Row="9" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="30,0,0,0">
487
                         <TextBlock Text="河南星火燎原软件科技有限公司" FontSize="14" Foreground="#333333"/>
497
                         <TextBlock Text="河南星火燎原软件科技有限公司" FontSize="14" Foreground="#333333"/>
488
                     </StackPanel>
498
                     </StackPanel>
489
 
499
 

+ 27
- 6
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

798
                     {
798
                     {
799
                         rbnAVI.IsChecked = true;
799
                         rbnAVI.IsChecked = true;
800
                     }
800
                     }
801
+
802
+                    string isHide= FileToolsCommon.GetConfigValue("IsHideSRTool"); //工具栏是否隐藏
803
+                    if(isHide.Equals("1"))
804
+                    {
805
+                        rbnHide.IsChecked = true;
806
+                    }
807
+                    else
808
+                    {
809
+                        rbnvisi.IsChecked = true;
810
+                    }
801
                     string isSound = FileToolsCommon.GetConfigValue("IsSound");//<!--声音 true 有 false 无-->
811
                     string isSound = FileToolsCommon.GetConfigValue("IsSound");//<!--声音 true 有 false 无-->
802
                     if (isSound == "true")
812
                     if (isSound == "true")
803
                     {
813
                     {
908
                 {
918
                 {
909
                     FileToolsCommon.SetConfigValue("IsSound", "false");
919
                     FileToolsCommon.SetConfigValue("IsSound", "false");
910
                 }
920
                 }
921
+
922
+
923
+                    UpdateHideSRToolConfig();
924
+
911
                 ///  < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
925
                 ///  < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
912
                 if (rbnRight.IsChecked == true)
926
                 if (rbnRight.IsChecked == true)
913
                 {
927
                 {
997
         /// </summary>
1011
         /// </summary>
998
         void UpdateHideSRToolConfig()
1012
         void UpdateHideSRToolConfig()
999
         {
1013
         {
1000
-            //隐藏
1001
-            FileToolsCommon.SetConfigValue("IsHideSRTool", "1");
1002
-            APP.IsHideSRTool = true;
1014
+            if(rbnHide.IsChecked == true)
1015
+            {
1016
+                //隐藏
1017
+                FileToolsCommon.SetConfigValue("IsHideSRTool", "1");
1018
+                APP.IsHideSRTool = true;
1019
+            }
1020
+           else
1021
+            {
1022
+                //显示
1023
+                FileToolsCommon.SetConfigValue("IsHideSRTool", "0");
1024
+                APP.IsHideSRTool = false;
1025
+            }
1003
 
1026
 
1004
-            //显示
1005
-            FileToolsCommon.SetConfigValue("IsHideSRTool", "0");
1006
-            APP.IsHideSRTool = false;
1027
+          
1007
         }
1028
         }
1008
         #endregion
1029
         #endregion
1009
 
1030
 

Loading…
Cancel
Save