Browse Source

清除字迹

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
fda1d3bc90

+ 8
- 0
Common/system/BlackboardNew.cs View File

@@ -111,6 +111,14 @@ namespace Common.system
111 111
         {
112 112
             if (step != null)
113 113
             {
114
+                if (pagenum + 1 > strokes_page_all.Count)
115
+                {
116
+                    ZBBPage pagetemp = new ZBBPage();
117
+                    pagetemp.lines.Add(new ZBBPageStep());
118
+                    strokes_page_all.Add(pagetemp);
119
+                }
120
+
121
+
114 122
                 ZBBPage page = strokes_page_all[pagenum];
115 123
                 if (page != null)
116 124
                 {

+ 4
- 3
XHWK.WKTool/JieTuWindow.xaml.cs View File

@@ -234,7 +234,8 @@ namespace ComeCapture
234 234
             //string imagePath = ImageHelper.GetImagePath(out string serverSavePath);
235 235
 
236 236
             //BitmapSource bitmap = ImageHelper.GetBitmapSource((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2, out JieTuBitmapPtr);
237
-           /* BitmapImage bitmap = */ImageHelper.GetScreenshot(new Rectangle((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2), imagePath,true,out BitmapImage bitmapimg);
237
+           /* BitmapImage bitmap = */
238
+            ImageHelper.GetScreenshot(new Rectangle((int)AppModel.Current.MaskLeftWidth + 1, (int)AppModel.Current.MaskTopHeight + 1, (int)MainImage.ActualWidth - 2, (int)MainImage.ActualHeight - 2), imagePath,true,out BitmapImage bitmapimg);
238 239
             _IsMouseDown = false;
239 240
             _IsCapture = false;
240 241
             ImageEditBar.Current.Visibility = Visibility.Collapsed;
@@ -242,8 +243,8 @@ namespace ComeCapture
242 243
             SizeRGB.Visibility = Visibility.Collapsed;
243 244
             MainImage.Visibility = Visibility.Collapsed;
244 245
             DataContext = new AppModel();
245
-            ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);//zxy
246
-            Background = new ImageBrush(bitmap);
246
+            //ImageHelper.GetScreenshot(new Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);//zxy
247
+            //Background = new ImageBrush(bitmap);
247 248
             WpfHelper.MainDispatcher = Dispatcher;
248 249
             MaxWindow();
249 250
             MaskLeft.Height = ScreenHeight;

+ 18
- 13
XHWK.WKTool/UploadWindow.xaml View File

@@ -16,9 +16,9 @@
16 16
             <!--分4行-->
17 17
             <Grid.RowDefinitions>
18 18
                 <RowDefinition Height="45"/>
19
-                <RowDefinition Height="80"/>
20
-                <RowDefinition Height="60"/>
21
-                <RowDefinition Height="60"/>
19
+                <RowDefinition Height="30"/>
20
+                <RowDefinition Height="90"/>
21
+                <RowDefinition Height="90"/>
22 22
                 <RowDefinition Height="*"/>
23 23
             </Grid.RowDefinitions>
24 24
             <!--第一行 标题-->
@@ -32,19 +32,19 @@
32 32
             <ComboBox Cursor="Hand"
33 33
                             x:Name="book_list"
34 34
                             Grid.Row="2"
35
-                            Height="30"
36
-                      Width="300"
35
+                            Height="50"
36
+                      Width="400"
37 37
                             Margin="0,0,0,0"
38 38
                             Padding="10,0,0,0"
39 39
                             VerticalContentAlignment="Center"
40 40
                             DisplayMemberPath="Value"
41
-                            FontSize="14"
41
+                            FontSize="18"
42 42
                             ItemsSource="{Binding bookList}"
43 43
                             SelectedValuePath="Key"
44
-                      SelectionChanged="toolbar_list_SelectionChanged"
44
+                      SelectionChanged="toolbar_list_SelectionChanged" BorderBrush="#FFCDD6E0" Foreground="Black" Background="White"
45 45
                           >
46 46
                 <ComboBox.Resources>
47
-                    <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="WhiteSmoke" />
47
+                    <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="White" />
48 48
                     <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Gray" />
49 49
                 </ComboBox.Resources>
50 50
             </ComboBox>
@@ -52,16 +52,21 @@
52 52
             <ComboBox Cursor="Hand"
53 53
                             x:Name="cmbTeachingMaterial"
54 54
                             Grid.Row="3"
55
-                               Height="30"
56
-                             Width="300"
55
+                               Height="50"
56
+                             Width="400"
57 57
                             Padding="10,0,0,0"
58 58
                             VerticalContentAlignment="Center"
59
-                            Background="White"
59
+                          
60 60
                             DisplayMemberPath="Value"
61
-                            FontSize="14"
61
+                            FontSize="18"
62 62
                             Foreground="Black"
63 63
                             ItemsSource="{Binding zhangjieList}"
64
-                            SelectedValuePath="Key" />
64
+                            SelectedValuePath="Key" BorderBrush="#FFCDD6E0" >
65
+                <ComboBox.Resources>
66
+                    <SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="White" />
67
+                    <!--<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Green" />-->
68
+                </ComboBox.Resources>
69
+            </ComboBox>
65 70
             <!--第四行 开始按钮-->
66 71
             <Button  Cursor="Hand" Grid.Row="4" x:Name="btnStart" Content="确定" FontSize="18" Foreground="#FFFFFF" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Width="418" Height="43" Margin="10,0,10,0" Click="BtnStart_Click">
67 72
                 <Button.Template>

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

@@ -289,12 +289,13 @@
289 289
                                     </Grid>
290 290
                                 </Border>
291 291
                             </Grid>
292
+                            <Image x:Name="imgDocumentation" Visibility="Visible"/>
293
+
292 294
                             <!--导入图片-->
293 295
                             <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
294 296
                             <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
295 297
                             
296
-                            <Image x:Name="imgDocumentation" Visibility="Visible" Width="0" Height="0" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="472,246,0,0" />
297
-
298
+                          
298 299
                             <!--摄像头-->
299 300
                             <!--<wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Height="124" Width="172" HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top">
300 301
                     <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />

+ 40
- 45
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

@@ -42,7 +42,7 @@ namespace XHWK.WKTool
42 42
         //private CountdownWindow FileDirectoryWindows = null;  
43 43
         private FolderBrowserDialog Ofd;
44 44
         private DialogResult Result;
45
-        public readonly BlackboardNew myblackboard;
45
+        public  BlackboardNew myblackboard;
46 46
         private System.Windows.Forms.DialogResult result;
47 47
         private System.Windows.Forms.OpenFileDialog ofd;
48 48
         //声明一个 DrawingAttributes 类型的变量  
@@ -885,6 +885,8 @@ namespace XHWK.WKTool
885 885
         /// <param name="e"></param>
886 886
         private void BtnScreenshot_Click(object sender, RoutedEventArgs e)
887 887
         {
888
+            HideAngleBorder();
889
+            imgCanvas.Margin = new Thickness(0, 0, 0, 0);
888 890
             APP.ImgPath = string.Empty;
889 891
             string time = GetTimeStamp();
890 892
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
@@ -947,6 +949,7 @@ namespace XHWK.WKTool
947 949
                     }
948 950
                     if (APP.PageDrawList.Count >= APP.pageData.currpage && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
949 951
                     {
952
+                      
950 953
                         imgDocumentation.Source = null;
951 954
                         BitmapImage bitImg=new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
952 955
                         imgCanvas.Source = bitImg;
@@ -956,6 +959,8 @@ namespace XHWK.WKTool
956 959
                         ImgPrint.Visibility = Visibility.Visible;//截图成功可打印
957 960
                         ImgPrintTwo.Visibility = Visibility.Collapsed;
958 961
                         btnPrint.IsEnabled = true;
962
+
963
+                   
959 964
                     }
960 965
                 }
961 966
                 this.Topmost = false;
@@ -1392,6 +1397,22 @@ namespace XHWK.WKTool
1392 1397
                     btnSetUp.IsEnabled = false;
1393 1398
 
1394 1399
                     btnLoginType.IsEnabled = false;
1400
+                    blackboard_canvas.Visibility = Visibility.Visible;//zxyceshi
1401
+
1402
+
1403
+                    //myblackboard = new BlackboardNew(blackboard_canvas);
1404
+                    //DataContext = APP.pageData;
1405
+                    //drawingAttributes = new DrawingAttributes();
1406
+                    ////将 InkCanvas 的 DefaultDrawingAttributes 属性的值赋成创建的 DrawingAttributes 类的对象的引用  
1407
+                    ////InkCanvas 通过 DefaultDrawingAttributes 属性来获取墨迹的各种设置,该属性的类型为 DrawingAttributes 型  
1408
+                    //blackboard_canvas.DefaultDrawingAttributes = drawingAttributes;
1409
+                    //blackboard_canvas.UseCustomCursor = true;
1410
+                    //drawingAttributes.FitToCurve = true;
1411
+                    //drawingAttributes.IgnorePressure = false;
1412
+                    //drawingAttributes.Width = PenSize;
1413
+                    //drawingAttributes.Height = PenSize;
1414
+                    //drawingAttributes.Color = Color;
1415
+                    //blackboard_canvas.Cursor = System.Windows.Input.Cursors.Pen;
1395 1416
                     #endregion
1396 1417
 
1397 1418
                     #region 录像倒计时
@@ -1587,6 +1608,21 @@ namespace XHWK.WKTool
1587 1608
                     APP.pageData.currpage = 0;
1588 1609
                     APP.pageData.pagenum = 0;
1589 1610
                     myblackboard.clear();
1611
+
1612
+                    //myblackboard = new BlackboardNew(blackboard_canvas);
1613
+                    //DataContext = APP.pageData;
1614
+                    //drawingAttributes = new DrawingAttributes();
1615
+                    ////将 InkCanvas 的 DefaultDrawingAttributes 属性的值赋成创建的 DrawingAttributes 类的对象的引用  
1616
+                    ////InkCanvas 通过 DefaultDrawingAttributes 属性来获取墨迹的各种设置,该属性的类型为 DrawingAttributes 型  
1617
+                    //blackboard_canvas.DefaultDrawingAttributes = drawingAttributes;
1618
+                    //blackboard_canvas.UseCustomCursor = true;
1619
+                    //drawingAttributes.FitToCurve = true;
1620
+                    //drawingAttributes.IgnorePressure = false;
1621
+                    //drawingAttributes.Width = PenSize;
1622
+                    //drawingAttributes.Height = PenSize;
1623
+                    //drawingAttributes.Color = Color;
1624
+                    //blackboard_canvas.Cursor = System.Windows.Input.Cursors.Pen;
1625
+
1590 1626
                     APP.PageDrawList.Clear();
1591 1627
                     imgCanvas.Source = null;
1592 1628
                     imgDocumentation.Source = null;
@@ -1689,9 +1725,10 @@ namespace XHWK.WKTool
1689 1725
                 blackboard_canvas.Visibility = Visibility.Visible;
1690 1726
             }
1691 1727
             APP.pageData.pagenum += 1;
1728
+            HideAngleBorder();
1692 1729
             gridPage.Visibility = Visibility.Visible;//页码大于0 显示
1693 1730
             APP.pageData.currpage = APP.pageData.pagenum;
1694
-            //myblackboard.changepage(APP.pageData.currpage - 1);
1731
+            myblackboard.changepage(APP.pageData.currpage - 1);
1695 1732
             ///清空页面图片UI
1696 1733
             imgCanvas.Source = null;
1697 1734
             imgDocumentation.Source = null;
@@ -3255,26 +3292,6 @@ namespace XHWK.WKTool
3255 3292
 
3256 3293
         }
3257 3294
         #endregion
3258
-
3259
-        /// <summary>
3260
-        /// 图片失去焦点事件
3261
-        /// </summary>
3262
-        /// <param name="sender"></param>
3263
-        /// <param name="e"></param>
3264
-        private void imgCanvas_LostFocus(object sender, RoutedEventArgs e)
3265
-        {
3266
-            //HideAngleBorder();
3267
-        }
3268
-
3269
-        /// <summary>
3270
-        /// 图片获取焦点事件
3271
-        /// </summary>
3272
-        /// <param name="sender"></param>
3273
-        /// <param name="e"></param>
3274
-        private void imgCanvas_GotFocus(object sender, RoutedEventArgs e)
3275
-        {
3276
-            ShowAngleBorder();
3277
-        }
3278 3295
         System.Windows.Point initialPoint;
3279 3296
         private void PicEMap_MouseDown(object sender, MouseButtonEventArgs e)
3280 3297
         {
@@ -3369,7 +3386,7 @@ namespace XHWK.WKTool
3369 3386
             }
3370 3387
             catch (Exception ex)
3371 3388
             {
3372
-                MessageWindow.Show(ex.Message);
3389
+                MessageWindow.Show("图片过小!");
3373 3390
             }
3374 3391
         }
3375 3392
 
@@ -3377,27 +3394,5 @@ namespace XHWK.WKTool
3377 3394
         {
3378 3395
             ShowAngleBorder();
3379 3396
         }
3380
-
3381
-        private void gridM_MouseDown(object sender, MouseButtonEventArgs e)
3382
-        {
3383
-        }
3384
-
3385
-        private void Canvas_MouseDown(object sender, MouseButtonEventArgs e)
3386
-        {
3387
-
3388
-        }
3389
-
3390
-        private void IMG_MouseDown(object sender, MouseButtonEventArgs e)
3391
-        {
3392
-        }
3393
-
3394
-        private void GridMain_MouseDown(object sender, MouseButtonEventArgs e)
3395
-        {
3396
-        }
3397
-
3398
-        private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
3399
-        {
3400
-            HideAngleBorder();
3401
-        }
3402 3397
     }
3403 3398
 }

+ 2
- 2
XHWK.WKTool/ZConfig.cs View File

@@ -13,9 +13,9 @@ namespace XHWK.WKTool.Config
13 13
         /// <summary>
14 14
         /// 当前版本号
15 15
         /// </summary>
16
-        public static int versionCode = 4;
16
+        public static int versionCode = 5;
17 17
 
18
-        public static string versionName = "1.0.3";
18
+        public static string versionName = "1.0.4";
19 19
 
20 20
         //接口地址
21 21
         public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : "http://schoolapi.xhkjedu.com";

Loading…
Cancel
Save