Browse Source

zhao:解决冲突

tags/录制修改前
耀 4 years ago
parent
commit
9650f55b02

+ 13
- 6
Common/system/BlackboardNew.cs View File

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

+ 10
- 6
Common/system/CameraHelper.cs View File

99
             try
99
             try
100
             {
100
             {
101
                 Image bitmap = sourcePlayer.GetCurrentVideoFrame();
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
             catch (Exception e)
112
             catch (Exception e)
109
             {
113
             {
110
-                System.Windows.Forms.MessageBox.Show(e.Message.ToString());
114
+          
111
                 return null;
115
                 return null;
112
             }
116
             }
113
         }
117
         }

+ 2
- 0
XHWK.Model/Model_DrawData.cs View File

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

+ 7
- 4
XHWK.WKTool/CountdownWindow.xaml.cs View File

42
             else
42
             else
43
             {
43
             {
44
                 timer.Enabled = false;
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
         /// <summary>
54
         /// <summary>

+ 34
- 14
XHWK.WKTool/LoginWindow.xaml.cs View File

1
 using Common.system;
1
 using Common.system;
2
 using System;
2
 using System;
3
 using System.Configuration;
3
 using System.Configuration;
4
+using System.IO;
4
 using System.Text;
5
 using System.Text;
5
 using System.Windows;
6
 using System.Windows;
6
 using XHWK.WKTool.DAL;
7
 using XHWK.WKTool.DAL;
23
         }
24
         }
24
         public void Initialize() 
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
         /// <summary>
43
         /// <summary>
33
         /// 关闭事件
44
         /// 关闭事件
76
             {
87
             {
77
                 FileToolsCommon.CreateDirectory(APP.DataPath);
88
                 FileToolsCommon.CreateDirectory(APP.DataPath);
78
                 string applicationData = APP.DataPath + "accountNumber.txt";
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
                 APP.IsLoginType = true;
104
                 APP.IsLoginType = true;
85
                 txbAccountNumber.Text = string.Empty;
105
                 txbAccountNumber.Text = string.Empty;
86
                 pobPassword.Password = string.Empty;
106
                 pobPassword.Password = string.Empty;
124
         /// <param name="e"></param>
144
         /// <param name="e"></param>
125
         private void CkSaveName_Click(object sender, RoutedEventArgs e)
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
         /// <summary>
156
         /// <summary>
137
         /// 读取客户设置
157
         /// 读取客户设置

+ 0
- 7
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

106
                             <TextBlock Text="上传" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
106
                             <TextBlock Text="上传" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
107
                         </StackPanel>
107
                         </StackPanel>
108
                     </Button>
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
                     <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnSetUp_Click">
109
                     <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnSetUp_Click">
117
                         <StackPanel Orientation="Vertical">
110
                         <StackPanel Orientation="Vertical">
118
                             <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>
111
                             <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>

+ 36
- 44
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

157
             {
157
             {
158
                 CameraHelper.SetCameraDevice(0);
158
                 CameraHelper.SetCameraDevice(0);
159
                 RbnOpen = new List<string>();
159
                 RbnOpen = new List<string>();
160
-                times = new System.Timers.Timer(200);//设置执行一次(false)还是一直执行(true)
160
+                times = new System.Timers.Timer(300);//设置执行一次(false)还是一直执行(true)
161
                 times.AutoReset = true;//设置是否执行System.Timers.Timer.Elapsed事件
161
                 times.AutoReset = true;//设置是否执行System.Timers.Timer.Elapsed事件
162
                 times.Elapsed += new System.Timers.ElapsedEventHandler(Times_Elapsed);
162
                 times.Elapsed += new System.Timers.ElapsedEventHandler(Times_Elapsed);
163
                 times.Enabled = true; //启动计时器
163
                 times.Enabled = true; //启动计时器
286
             //    }
286
             //    }
287
             //}
287
             //}
288
             #endregion   
288
             #endregion   
289
-
290
             if (APP.W_ScreenRecordingToolbarWindow == null)
289
             if (APP.W_ScreenRecordingToolbarWindow == null)
291
             {
290
             {
292
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
291
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
637
             {
636
             {
638
                 txbLoginType.Text = APP.UserInfo.Username;
637
                 txbLoginType.Text = APP.UserInfo.Username;
639
 
638
 
640
-                ImgMyMine.Visibility = Visibility.Visible;
641
-                ImgMyMineTwo.Visibility = Visibility.Collapsed;
642
                 ImgUpload.Visibility = Visibility.Visible;
639
                 ImgUpload.Visibility = Visibility.Visible;
643
                 ImgUploadTwo.Visibility = Visibility.Collapsed;
640
                 ImgUploadTwo.Visibility = Visibility.Collapsed;
644
             }
641
             }
646
             {
643
             {
647
                 txbLoginType.Text = "未登录";
644
                 txbLoginType.Text = "未登录";
648
 
645
 
649
-                ImgMyMine.Visibility = Visibility.Collapsed;
650
-                ImgMyMineTwo.Visibility = Visibility.Visible;
651
                 ImgUpload.Visibility = Visibility.Collapsed;
646
                 ImgUpload.Visibility = Visibility.Collapsed;
652
                 ImgUploadTwo.Visibility = Visibility.Visible;
647
                 ImgUploadTwo.Visibility = Visibility.Visible;
653
             }
648
             }
1118
                     ImgUploadTwo.Visibility = Visibility.Visible;
1113
                     ImgUploadTwo.Visibility = Visibility.Visible;
1119
                     btnUpload.IsEnabled = false;
1114
                     btnUpload.IsEnabled = false;
1120
 
1115
 
1121
-                    ImgMyMine.Visibility = Visibility.Collapsed;//录制中不可点击我的
1122
-                    ImgMyMineTwo.Visibility = Visibility.Visible;
1123
-                    btnMyMine.IsEnabled = false;
1124
-
1125
                     ImgSetUp.Visibility = Visibility.Collapsed;//录制中不可设置
1116
                     ImgSetUp.Visibility = Visibility.Collapsed;//录制中不可设置
1126
                     ImgSetUpTwo.Visibility = Visibility.Visible;
1117
                     ImgSetUpTwo.Visibility = Visibility.Visible;
1127
                     btnSetUp.IsEnabled = false;
1118
                     btnSetUp.IsEnabled = false;
1247
                 ImgUploadTwo.Visibility = Visibility.Collapsed;
1238
                 ImgUploadTwo.Visibility = Visibility.Collapsed;
1248
                 btnUpload.IsEnabled = true;
1239
                 btnUpload.IsEnabled = true;
1249
 
1240
 
1250
-                ImgMyMine.Visibility = Visibility.Visible;
1251
-                ImgMyMineTwo.Visibility = Visibility.Collapsed;
1252
-                btnMyMine.IsEnabled = true;
1253
-
1254
                 ImgSetUp.Visibility = Visibility.Visible;
1241
                 ImgSetUp.Visibility = Visibility.Visible;
1255
                 ImgSetUpTwo.Visibility = Visibility.Collapsed;
1242
                 ImgSetUpTwo.Visibility = Visibility.Collapsed;
1256
                 btnSetUp.IsEnabled = true;
1243
                 btnSetUp.IsEnabled = true;
1404
             if (APP.W_PrintWindow == null)
1391
             if (APP.W_PrintWindow == null)
1405
             {
1392
             {
1406
                 APP.W_PrintWindow = new PrintWindow();
1393
                 APP.W_PrintWindow = new PrintWindow();
1407
-                APP.W_PrintWindow.Topmost = true;
1394
+                //APP.W_PrintWindow.Topmost = true;
1408
                 APP.W_PrintWindow.Owner = this;
1395
                 APP.W_PrintWindow.Owner = this;
1409
             }
1396
             }
1410
             if (APP.PageDrawList.Count > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[0].PdfImagePath))
1397
             if (APP.PageDrawList.Count > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[0].PdfImagePath))
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
         /// </summary>
1425
         /// </summary>
1448
         /// <param name="sender"></param>
1426
         /// <param name="sender"></param>
1489
                         {
1467
                         {
1490
                             imgDocumentation.Source = null;
1468
                             imgDocumentation.Source = null;
1491
                             imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
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
                             if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1471
                             if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1494
                             {
1472
                             {
1495
                                 var group = IMG.FindResource("Imageview") as TransformGroup;
1473
                                 var group = IMG.FindResource("Imageview") as TransformGroup;
1496
                                 var transform = group.Children[1] as TranslateTransform;
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
                                 //var position = e.GetPosition(img);
1483
                                 //var position = e.GetPosition(img);
1504
                                 transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1484
                                 transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1505
                                 transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1485
                                 transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1566
                         {
1546
                         {
1567
                             //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
1547
                             //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
1568
                             imgDocumentation.Source = null;
1548
                             imgDocumentation.Source = null;
1549
+
1569
                             imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1550
                             imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1551
+                            APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
1570
                             if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1552
                             if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1571
                             {
1553
                             {
1572
                                 var group = IMG.FindResource("Imageview") as TransformGroup;
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
                                 var transform = group.Children[1] as TranslateTransform;
1563
                                 var transform = group.Children[1] as TranslateTransform;
1580
                                 //var position = e.GetPosition(img);
1564
                                 //var position = e.GetPosition(img);
1581
                                 transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1565
                                 transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1582
                                 transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1566
                                 transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1583
 
1567
 
1568
+                                
1584
 
1569
 
1585
                                 mouseDown = false;
1570
                                 mouseDown = false;
1586
                             }
1571
                             }
1779
             var transform1 = group.Children[1] as TranslateTransform;
1764
             var transform1 = group.Children[1] as TranslateTransform;
1780
             transform1.X = -1 * ((pointToContent.X * transform.ScaleX) - point.X);
1765
             transform1.X = -1 * ((pointToContent.X * transform.ScaleX) - point.X);
1781
             transform1.Y = -1 * ((pointToContent.Y * transform.ScaleY) - point.Y);
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
             //Console.WriteLine("transform.ScaleX = " + transform.ScaleX + "; transform.ScaleY = " + transform.ScaleY);
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
         #endregion
1784
         #endregion
1793
 
1785
 

Loading…
Cancel
Save