Просмотр исходного кода

zhao:解决冲突

tags/录制修改前
耀 4 лет назад
Родитель
Сommit
9650f55b02

+ 13
- 6
Common/system/BlackboardNew.cs Просмотреть файл

@@ -332,14 +332,14 @@ namespace Common.system
332 332
         StylusPointCollection stylusPoints = new StylusPointCollection();
333 333
         StylusPoint stylusPoint = new StylusPoint();
334 334
         Stroke stroke;
335
-        //bool isFirst = true;
335
+        bool isFirst = true;
336 336
         //public void changepages(double _x, double _y, bool _new, Color _color, int _size)
337 337
         //{
338 338
         //    if (_new)
339 339
         //    {
340 340
         //        if (stroke != null && stroke.StylusPoints.Count > 1)
341 341
         //        {
342
-        //             drawingAttributes = new DrawingAttributes();
342
+        //            drawingAttributes = new DrawingAttributes();
343 343
         //            //m_canvas.DefaultDrawingAttributes = drawingAttributes;
344 344
         //            drawingAttributes.Color = _color;
345 345
         //            drawingAttributes.Width = _size;
@@ -358,12 +358,12 @@ namespace Common.system
358 358
         //    }
359 359
         //    else
360 360
         //    {
361
-        //        if(isFirst)
361
+        //        if (isFirst)
362 362
         //        {
363 363
         //            stylusPoint.X = _x;
364 364
         //            stylusPoint.Y = _y;
365 365
         //            stylusPoints.Add(stylusPoint);
366
-        //            if (stylusPoints.Count>1)
366
+        //            if (stylusPoints.Count > 1)
367 367
         //            {
368 368
         //                stroke = new Stroke(stylusPoints);
369 369
         //                m_canvas.Strokes.Add(stroke);
@@ -372,6 +372,7 @@ namespace Common.system
372 372
         //        }
373 373
         //        else
374 374
         //        {
375
+        //            if(m_canvas.Strokes.Count)
375 376
         //            stylusPoint.X = _x;
376 377
         //            stylusPoint.Y = _y;
377 378
         //            stylusPoints.Add(stylusPoint);
@@ -405,8 +406,8 @@ namespace Common.system
405 406
                     drawingAttributes = new DrawingAttributes();
406 407
                     //m_canvas.DefaultDrawingAttributes = drawingAttributes;
407 408
                     drawingAttributes.Color = _color;
408
-                    drawingAttributes.Width = _size*5;
409
-                    drawingAttributes.Height = _size*5;
409
+                    drawingAttributes.Width = _size * 5;
410
+                    drawingAttributes.Height = _size * 5;
410 411
                     drawingAttributes.FitToCurve = true;
411 412
                     drawingAttributes.IgnorePressure = false;
412 413
 
@@ -430,6 +431,12 @@ namespace Common.system
430 431
                 stroke = new Stroke(stylusPoints);
431 432
             }
432 433
         }
434
+
435
+
436
+
437
+
438
+
439
+
433 440
         ////声明一个 DrawingAttributes 类型的变量  
434 441
         //DrawingAttributes drawingAttributes;
435 442
         //public void changepaget(double _x, double _y, bool _new,InkCanvas canvas) 

+ 10
- 6
Common/system/CameraHelper.cs Просмотреть файл

@@ -99,15 +99,19 @@ namespace Common.system
99 99
             try
100 100
             {
101 101
                 Image bitmap = sourcePlayer.GetCurrentVideoFrame();
102
-                if (fileName == null) fileName = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
103
-                string fullPath = Path.Combine(filePath, fileName + "-cap.jpg");
104
-                bitmap.Save(fullPath, ImageFormat.Jpeg);
105
-                bitmap.Dispose();
106
-                return fullPath;
102
+                if(bitmap!=null)
103
+                {
104
+                    if (fileName == null) fileName = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
105
+                    string fullPath = Path.Combine(filePath, fileName + "-cap.jpg");
106
+                    bitmap.Save(fullPath, ImageFormat.Jpeg);
107
+                    bitmap.Dispose();
108
+                    return fullPath;
109
+                }
110
+                return null;
107 111
             }
108 112
             catch (Exception e)
109 113
             {
110
-                System.Windows.Forms.MessageBox.Show(e.Message.ToString());
114
+          
111 115
                 return null;
112 116
             }
113 117
         }

+ 2
- 0
XHWK.Model/Model_DrawData.cs Просмотреть файл

@@ -18,6 +18,7 @@ namespace XHWK.Model
18 18
         private string _pageImagePath;
19 19
         private TranslateTransform _ImageLocation;
20 20
         private ScaleTransform _ImageSize;
21
+        private ScaleTransform _ImageSizes;
21 22
         private bool _IsImageLocation;
22 23
         //private string _PenColor;
23 24
         //private int _PenWigth;
@@ -56,6 +57,7 @@ namespace XHWK.Model
56 57
         /// true 文档图片  folse 截图图片
57 58
         /// </summary>
58 59
         public bool ImgDocumentation { get => _imgDocumentation; set => _imgDocumentation = value; }
60
+        public ScaleTransform ImageSizes { get => _ImageSizes; set => _ImageSizes = value; }
59 61
         ///// <summary>
60 62
         ///// 笔颜色 十六进制
61 63
         ///// </summary>

+ 7
- 4
XHWK.WKTool/CountdownWindow.xaml.cs Просмотреть файл

@@ -42,10 +42,13 @@ namespace XHWK.WKTool
42 42
             else
43 43
             {
44 44
                 timer.Enabled = false;
45
-                Dispatcher.Invoke(() =>
46
-                {
47
-                    Hide();
48
-                });
45
+                Dispatcher.Invoke(
46
+                  DispatcherPriority.Send,
47
+                  new Action(() =>
48
+                  {
49
+                      imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_3.png"));
50
+                      Hide();
51
+                  }));
49 52
             }
50 53
         }
51 54
         /// <summary>

+ 34
- 14
XHWK.WKTool/LoginWindow.xaml.cs Просмотреть файл

@@ -1,6 +1,7 @@
1 1
 using Common.system;
2 2
 using System;
3 3
 using System.Configuration;
4
+using System.IO;
4 5
 using System.Text;
5 6
 using System.Windows;
6 7
 using XHWK.WKTool.DAL;
@@ -23,11 +24,21 @@ namespace XHWK.WKTool
23 24
         }
24 25
         public void Initialize() 
25 26
         {
26
-            if (GetSettingString("isRemind").Equals("True"))
27
+
28
+            if (FileToolsCommon.IsExistFile(APP.DataPath + "accountNumber.txt"))
27 29
             {
28
-                ckSaveName.IsChecked = true;
29
-                txbAccountNumber.Text = GetSettingString("userName");
30
+                string accountNumber = System.IO.File.ReadAllText(APP.DataPath + "accountNumber.txt", Encoding.Default);
31
+                if(!string.IsNullOrWhiteSpace(accountNumber))
32
+                {
33
+                    txbAccountNumber.Text = accountNumber;
34
+                    ckSaveName.IsChecked = true;
35
+                }
30 36
             }
37
+            //if (GetSettingString("isRemind").Equals("True"))
38
+            //{
39
+            //    ckSaveName.IsChecked = true;
40
+            //    txbAccountNumber.Text = GetSettingString("userName");
41
+            //}
31 42
         }
32 43
         /// <summary>
33 44
         /// 关闭事件
@@ -76,11 +87,20 @@ namespace XHWK.WKTool
76 87
             {
77 88
                 FileToolsCommon.CreateDirectory(APP.DataPath);
78 89
                 string applicationData = APP.DataPath + "accountNumber.txt";
79
-                string accountNumbers = DateTime.Now.ToLongDateString().ToString();//当前时间 
80
-                System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放签名验证日期
90
+                if (ckSaveName.IsChecked==true)
91
+                {
92
+                    
93
+                    string accountNumbers = txbAccountNumber.Text;
94
+                    System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放账号
95
+                }
96
+                else
97
+                {
98
+                    string accountNumbers = "";
99
+                    System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放账号
100
+                }
81 101
 
82 102
 
83
-                UpdateSettingString("userName", txbAccountNumber.Text);
103
+                //UpdateSettingString("userName", txbAccountNumber.Text);
84 104
                 APP.IsLoginType = true;
85 105
                 txbAccountNumber.Text = string.Empty;
86 106
                 pobPassword.Password = string.Empty;
@@ -124,14 +144,14 @@ namespace XHWK.WKTool
124 144
         /// <param name="e"></param>
125 145
         private void CkSaveName_Click(object sender, RoutedEventArgs e)
126 146
         {
127
-            if (ckSaveName.IsChecked == false)
128
-            {
129
-                UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
130
-            }
131
-            else
132
-            {
133
-                UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
134
-            }
147
+            //if (ckSaveName.IsChecked == false)
148
+            //{
149
+            //    UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
150
+            //}
151
+            //else
152
+            //{
153
+            //    UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
154
+            //}
135 155
         }
136 156
         /// <summary>
137 157
         /// 读取客户设置

+ 0
- 7
XHWK.WKTool/XHMicroLessonSystemWindow.xaml Просмотреть файл

@@ -106,13 +106,6 @@
106 106
                             <TextBlock Text="上传" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
107 107
                         </StackPanel>
108 108
                     </Button>
109
-                    <Button Cursor="Hand" x:Name="btnMyMine" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,30,0" Click="BtnMyMine_Click">
110
-                        <StackPanel Orientation="Vertical">
111
-                            <Image x:Name="ImgMyMine" Source="./Images/microLessonSystem_22.png" Visibility="Collapsed"/>
112
-                            <Image x:Name="ImgMyMineTwo" Source="./Images/microLessonSystem_1.png" Visibility="Visible"/>
113
-                            <TextBlock Text="我的" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
114
-                        </StackPanel>
115
-                    </Button>
116 109
                     <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnSetUp_Click">
117 110
                         <StackPanel Orientation="Vertical">
118 111
                             <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>

+ 36
- 44
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Просмотреть файл

@@ -157,7 +157,7 @@ namespace XHWK.WKTool
157 157
             {
158 158
                 CameraHelper.SetCameraDevice(0);
159 159
                 RbnOpen = new List<string>();
160
-                times = new System.Timers.Timer(200);//设置执行一次(false)还是一直执行(true)
160
+                times = new System.Timers.Timer(300);//设置执行一次(false)还是一直执行(true)
161 161
                 times.AutoReset = true;//设置是否执行System.Timers.Timer.Elapsed事件
162 162
                 times.Elapsed += new System.Timers.ElapsedEventHandler(Times_Elapsed);
163 163
                 times.Enabled = true; //启动计时器
@@ -286,7 +286,6 @@ namespace XHWK.WKTool
286 286
             //    }
287 287
             //}
288 288
             #endregion   
289
-
290 289
             if (APP.W_ScreenRecordingToolbarWindow == null)
291 290
             {
292 291
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
@@ -637,8 +636,6 @@ namespace XHWK.WKTool
637 636
             {
638 637
                 txbLoginType.Text = APP.UserInfo.Username;
639 638
 
640
-                ImgMyMine.Visibility = Visibility.Visible;
641
-                ImgMyMineTwo.Visibility = Visibility.Collapsed;
642 639
                 ImgUpload.Visibility = Visibility.Visible;
643 640
                 ImgUploadTwo.Visibility = Visibility.Collapsed;
644 641
             }
@@ -646,8 +643,6 @@ namespace XHWK.WKTool
646 643
             {
647 644
                 txbLoginType.Text = "未登录";
648 645
 
649
-                ImgMyMine.Visibility = Visibility.Collapsed;
650
-                ImgMyMineTwo.Visibility = Visibility.Visible;
651 646
                 ImgUpload.Visibility = Visibility.Collapsed;
652 647
                 ImgUploadTwo.Visibility = Visibility.Visible;
653 648
             }
@@ -1118,10 +1113,6 @@ namespace XHWK.WKTool
1118 1113
                     ImgUploadTwo.Visibility = Visibility.Visible;
1119 1114
                     btnUpload.IsEnabled = false;
1120 1115
 
1121
-                    ImgMyMine.Visibility = Visibility.Collapsed;//录制中不可点击我的
1122
-                    ImgMyMineTwo.Visibility = Visibility.Visible;
1123
-                    btnMyMine.IsEnabled = false;
1124
-
1125 1116
                     ImgSetUp.Visibility = Visibility.Collapsed;//录制中不可设置
1126 1117
                     ImgSetUpTwo.Visibility = Visibility.Visible;
1127 1118
                     btnSetUp.IsEnabled = false;
@@ -1247,10 +1238,6 @@ namespace XHWK.WKTool
1247 1238
                 ImgUploadTwo.Visibility = Visibility.Collapsed;
1248 1239
                 btnUpload.IsEnabled = true;
1249 1240
 
1250
-                ImgMyMine.Visibility = Visibility.Visible;
1251
-                ImgMyMineTwo.Visibility = Visibility.Collapsed;
1252
-                btnMyMine.IsEnabled = true;
1253
-
1254 1241
                 ImgSetUp.Visibility = Visibility.Visible;
1255 1242
                 ImgSetUpTwo.Visibility = Visibility.Collapsed;
1256 1243
                 btnSetUp.IsEnabled = true;
@@ -1404,7 +1391,7 @@ namespace XHWK.WKTool
1404 1391
             if (APP.W_PrintWindow == null)
1405 1392
             {
1406 1393
                 APP.W_PrintWindow = new PrintWindow();
1407
-                APP.W_PrintWindow.Topmost = true;
1394
+                //APP.W_PrintWindow.Topmost = true;
1408 1395
                 APP.W_PrintWindow.Owner = this;
1409 1396
             }
1410 1397
             if (APP.PageDrawList.Count > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[0].PdfImagePath))
@@ -1434,15 +1421,6 @@ namespace XHWK.WKTool
1434 1421
 
1435 1422
             //}
1436 1423
         }
1437
-        /// <summary>
1438
-        /// 我的
1439
-        /// </summary>
1440
-        /// <param name="sender"></param>
1441
-        /// <param name="e"></param>
1442
-        private void BtnMyMine_Click(object sender, RoutedEventArgs e)
1443
-        {
1444
-        }
1445
-        /// <summary>
1446 1424
         /// 上一页
1447 1425
         /// </summary>
1448 1426
         /// <param name="sender"></param>
@@ -1489,17 +1467,19 @@ namespace XHWK.WKTool
1489 1467
                         {
1490 1468
                             imgDocumentation.Source = null;
1491 1469
                             imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1492
-                      
1470
+                            APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
1493 1471
                             if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1494 1472
                             {
1495 1473
                                 var group = IMG.FindResource("Imageview") as TransformGroup;
1496 1474
                                 var transform = group.Children[1] as TranslateTransform;
1497
-                                //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1498
-                                //{
1499
-                                //    var transform1 = group.Children[0] as ScaleTransform;
1500
-                                //    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1501
-                                //    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1502
-                                //}
1475
+                                if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1476
+                                {
1477
+                                    var transform1 = group.Children[0] as ScaleTransform;
1478
+                                    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1479
+                                    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1480
+                                    imgCanvas.Width = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterX;
1481
+                                    imgCanvas.Height = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterY;
1482
+                                }
1503 1483
                                 //var position = e.GetPosition(img);
1504 1484
                                 transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1505 1485
                                 transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
@@ -1566,21 +1546,26 @@ namespace XHWK.WKTool
1566 1546
                         {
1567 1547
                             //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
1568 1548
                             imgDocumentation.Source = null;
1549
+
1569 1550
                             imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1551
+                            APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
1570 1552
                             if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1571 1553
                             {
1572 1554
                                 var group = IMG.FindResource("Imageview") as TransformGroup;
1573
-                                //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1574
-                                //{
1575
-                                //    var transform1 = group.Children[0] as ScaleTransform;
1576
-                                //    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1577
-                                //    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1578
-                                //}
1555
+                                if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1556
+                                {
1557
+                                    var transform1 = group.Children[0] as ScaleTransform;
1558
+                                    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1559
+                                    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1560
+                                    imgCanvas.Width = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterX;
1561
+                                    imgCanvas.Height = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterY;
1562
+                                }
1579 1563
                                 var transform = group.Children[1] as TranslateTransform;
1580 1564
                                 //var position = e.GetPosition(img);
1581 1565
                                 transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1582 1566
                                 transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1583 1567
 
1568
+                                
1584 1569
 
1585 1570
                                 mouseDown = false;
1586 1571
                             }
@@ -1779,15 +1764,22 @@ namespace XHWK.WKTool
1779 1764
             var transform1 = group.Children[1] as TranslateTransform;
1780 1765
             transform1.X = -1 * ((pointToContent.X * transform.ScaleX) - point.X);
1781 1766
             transform1.Y = -1 * ((pointToContent.Y * transform.ScaleY) - point.Y);
1767
+            LogHelper.WriteInfoLog("【img宽高】" + imgCanvas.ActualWidth.ToString() + ":"
1768
+                 + imgCanvas.ActualHeight.ToString() + "百分比:" + transform.ScaleX.ToString() + ":" + transform.ScaleY.ToString()
1769
+                );
1770
+
1782 1771
             //Console.WriteLine("transform.ScaleX = " + transform.ScaleX + "; transform.ScaleY = " + transform.ScaleY);
1783 1772
 
1784
-            //APP.PageDrawList[APP.pageData.currpage - 1].ImageSize = new ScaleTransform();
1785
-            //APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX = transform.ScaleX;
1786
-            //APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY = transform.ScaleY;
1787
-            //APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation = new TranslateTransform();
1788
-            //APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X = transform1.X;
1789
-            //APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y = transform1.Y;
1790
-            //APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
1773
+            APP.PageDrawList[APP.pageData.currpage - 1].ImageSize = new ScaleTransform();
1774
+            APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX = transform.ScaleX;
1775
+            APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY = transform.ScaleY;
1776
+            APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation = new TranslateTransform();
1777
+            APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X = transform1.X;
1778
+            APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y = transform1.Y;
1779
+            APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes = new ScaleTransform();
1780
+            APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterX = imgCanvas.ActualWidth;
1781
+            APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterY = imgCanvas.ActualHeight;
1782
+            APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
1791 1783
         }
1792 1784
         #endregion
1793 1785
 

Загрузка…
Отмена
Сохранить