Selaa lähdekoodia

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

tags/录制修改前
耀 3 vuotta sitten
vanhempi
commit
72f07d7e6a

+ 75
- 8
XHWK.WKTool/PracticeWindow.xaml.cs Näytä tiedosto

@@ -22,7 +22,7 @@ namespace XHWK.WKTool
22 22
     {
23 23
         //声明一个 DrawingAttributes 类型的变量  
24 24
         private DrawingAttributes drawingAttributes;
25
-
25
+        private DrawingAttributes drawing;
26 26
         private ViewModel viewModel;
27 27
         /// <summary>
28 28
         /// 0 画笔 1 矩形 2 圆形 
@@ -108,9 +108,7 @@ namespace XHWK.WKTool
108 108
         /// <param name="e"></param>
109 109
         public void Red()
110 110
         {
111
-            //flg = 0;
112
-            //设置 DrawingAttributes 的 Color 属性设置颜色  
113
-            drawingAttributes.Color = Colors.Red;
111
+                drawingAttributes.Color = Colors.Red;
114 112
             Colour = Colors.Red;
115 113
         }
116 114
         /// <summary>
@@ -562,6 +560,13 @@ namespace XHWK.WKTool
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 572
         /// <summary>
@@ -694,26 +699,88 @@ namespace XHWK.WKTool
694 699
                 double testX = cy * PropW;
695 700
                 double testY = (A4_WIDTH - cx) * PropH;
696 701
                 //pageSerial //点阵IP地址  与打印的页面关联
697
-                if (APP.pageData.currpage > 0)
702
+                if (true)
698 703
                 {
699 704
                     Dispatcher.Invoke(new Action(() =>
700 705
                     {
701 706
                         float Pressure = force / 100f;
702
-                        //添加笔画
707
+                        ////添加笔画
703 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 770
                         if (testX > 0 && testY > 0)
707 771
                         {
708 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 784
         /// <summary>
718 785
         /// 停止笔
719 786
         /// </summary>

+ 26
- 16
XHWK.WKTool/XHMicroLessonSystemWindow.xaml Näytä tiedosto

@@ -377,6 +377,7 @@
377 377
                         <RowDefinition Height="50"/>
378 378
                         <RowDefinition Height="50"/>
379 379
                         <RowDefinition Height="50"/>
380
+                        <RowDefinition Height="50"/>
380 381
                         <RowDefinition Height="*"/>
381 382
                     </Grid.RowDefinitions>
382 383
                     <Grid.ColumnDefinitions>
@@ -394,14 +395,23 @@
394 395
                         <RadioButton x:Name="rbnAVI" Cursor="Hand" Style="{StaticResource radBase}" Content=" AVI" FontSize="14" Foreground="#333333" Margin="20,-26,0,0" Visibility="Collapsed"/>
395 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 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 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 410
                         <RadioButton Cursor="Hand" x:Name="rbnRightUnder" Style="{StaticResource radBase}" Content=" 右下" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="20,0,0,0"/>
401 411
                         <RadioButton Cursor="Hand" x:Name="rbnLeft" Style="{StaticResource radBase}" Content=" 左上" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="20,0,0,0" />
402 412
                         <RadioButton Cursor="Hand" x:Name="rbnLeftUnder" Style="{StaticResource radBase}" Content=" 左下" FontSize="14" Foreground="#333333"  VerticalAlignment="Top" Margin="20,0,0,0"/>
403 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 415
                         <TextBlock Text="视频声音" FontSize="16" Foreground="#2D8CF0" Width="80"/>
406 416
                         <RadioButton x:Name="rbnY" Cursor="Hand" Content="有" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
407 417
                         <RadioButton x:Name="rbnN" Cursor="Hand" Content="无" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
@@ -409,28 +419,28 @@
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 424
                         <TextBlock Text="http://" FontSize="14" Padding="0,0,5,0"/>
415 425
                         <TextBox x:Name="txbInterfaceAddress" FontSize="14" Width="467" Height="30" Margin="0,-30,0,0"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
416 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 431
                         <TextBlock Text="http://" FontSize="14" Padding="0,0,5,0"/>
422 432
                         <TextBox x:Name="txbImageUploadAddress" FontSize="14" Margin="0,-30,0,0" Width="467" Height="30"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
423 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 438
                         <TextBlock Text="http://" FontSize="14" Padding="0,0,5,0"/>
429 439
                         <TextBox x:Name="txbPictureShowsAddress" FontSize="14" Margin="0,-30,0,0" Width="467" Height="30"  VerticalContentAlignment="Center" Padding="5,0,0,0"/>
430 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 444
                         <Border Background="#CDD6E0" Width="515" Height="30" CornerRadius="3" Margin="0,-30,0,0">
435 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 446
                         </Border>
@@ -473,17 +483,17 @@
473 483
                             </Button.Template>
474 484
                         </Button>
475 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 488
                         <TextBlock  FontSize="14" Foreground="#333333" Text="开始/暂停:Ctrl+F5     停止:Ctrl+S     退出讲评:鼠标右键" Margin="30,0,0,0"/>
479 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 492
                         <TextBlock x:Name="txbv" Text="V0.0.0" FontSize="16" Foreground="#333333"/>
483 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 497
                         <TextBlock Text="河南星火燎原软件科技有限公司" FontSize="14" Foreground="#333333"/>
488 498
                     </StackPanel>
489 499
 

+ 27
- 6
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Näytä tiedosto

@@ -798,6 +798,16 @@ namespace XHWK.WKTool
798 798
                     {
799 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 811
                     string isSound = FileToolsCommon.GetConfigValue("IsSound");//<!--声音 true 有 false 无-->
802 812
                     if (isSound == "true")
803 813
                     {
@@ -908,6 +918,10 @@ namespace XHWK.WKTool
908 918
                 {
909 919
                     FileToolsCommon.SetConfigValue("IsSound", "false");
910 920
                 }
921
+
922
+
923
+                    UpdateHideSRToolConfig();
924
+
911 925
                 ///  < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
912 926
                 if (rbnRight.IsChecked == true)
913 927
                 {
@@ -997,13 +1011,20 @@ namespace XHWK.WKTool
997 1011
         /// </summary>
998 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 1029
         #endregion
1009 1030
 

Loading…
Peruuta
Tallenna