瀏覽代碼

文档img

tags/录制修改前
zhangxueyang 4 年之前
父節點
當前提交
0d82a829c2
共有 1 個檔案被更改,包括 57 行新增32 行删除
  1. 57
    32
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 57
- 32
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs 查看文件

@@ -707,7 +707,7 @@ namespace XHWK.WKTool
707 707
                         imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
708 708
                         //btnOk.Visibility = Visibility.Visible;
709 709
                         //blackboard_canvas.Visibility = Visibility.Collapsed;
710
-
710
+                        APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation = false;
711 711
                         ImgPrint.Visibility = Visibility.Visible;//截图成功可打印
712 712
                         ImgPrintTwo.Visibility = Visibility.Collapsed;
713 713
                         btnPrint.IsEnabled = true;
@@ -851,6 +851,7 @@ namespace XHWK.WKTool
851 851
                                     APP.PageDrawList[i].PageImagePath = page[i]; //zxycs
852 852
                                     APP.PageDrawList[i].PdfImagePath = page[i];
853 853
                                     APP.PageDrawList[i].PageNum = i + 1;
854
+                                    APP.PageDrawList[i].ImgDocumentation = true;
854 855
                                 }
855 856
                                 else
856 857
                                 {
@@ -859,6 +860,7 @@ namespace XHWK.WKTool
859 860
                                     model_DrawData.PageImagePath = page[i];
860 861
                                     model_DrawData.PdfImagePath = page[i];
861 862
                                     model_DrawData.PageNum = i + 1;
863
+                                    model_DrawData.ImgDocumentation = true;
862 864
                                     APP.PageDrawList.Add(model_DrawData);
863 865
                                 }
864 866
                                 ImgPrint.Visibility = Visibility.Visible;//导入成功可打印
@@ -912,6 +914,7 @@ namespace XHWK.WKTool
912 914
                                     APP.PageDrawList[i].PageImagePath = page[i]; //zxycs
913 915
                                     APP.PageDrawList[i].PdfImagePath = page[i];
914 916
                                     APP.PageDrawList[i].PageNum = i + 1;
917
+                                    APP.PageDrawList[i].ImgDocumentation = true;
915 918
                                 }
916 919
                                 else
917 920
                                 {
@@ -920,6 +923,7 @@ namespace XHWK.WKTool
920 923
                                     model_DrawData.PageImagePath = page[i];
921 924
                                     model_DrawData.PdfImagePath = page[i];
922 925
                                     model_DrawData.PageNum = i + 1;
926
+                                    model_DrawData.ImgDocumentation = true;
923 927
                                     APP.PageDrawList.Add(model_DrawData);
924 928
                                 }
925 929
                                 ImgPrint.Visibility = Visibility.Visible;//导入成功可打印
@@ -1484,27 +1488,38 @@ namespace XHWK.WKTool
1484 1488
                     {
1485 1489
                         //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
1486 1490
 
1487
-                        imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1488
-                        if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1491
+                        if (APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
1489 1492
                         {
1490
-                            var group = IMG.FindResource("Imageview") as TransformGroup;
1491
-                            var transform = group.Children[1] as TranslateTransform;
1492
-                            //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1493
-                            //{
1494
-                            //    var transform1 = group.Children[0] as ScaleTransform;
1495
-                            //    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1496
-                            //    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1497
-                            //}
1498
-                            //var position = e.GetPosition(img);
1499
-                            transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1500
-                            transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1501
-                            mouseDown = false;
1493
+                            imgCanvas.Source = null;
1494
+                            imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1495
+                        }
1496
+                        else
1497
+                        {
1498
+                            imgDocumentation.Source = null;
1499
+                            imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1500
+                      
1501
+                            if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1502
+                            {
1503
+                                var group = IMG.FindResource("Imageview") as TransformGroup;
1504
+                                var transform = group.Children[1] as TranslateTransform;
1505
+                                //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1506
+                                //{
1507
+                                //    var transform1 = group.Children[0] as ScaleTransform;
1508
+                                //    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1509
+                                //    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1510
+                                //}
1511
+                                //var position = e.GetPosition(img);
1512
+                                transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1513
+                                transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1514
+                                mouseDown = false;
1502 1515
 
1516
+                            }
1503 1517
                         }
1504 1518
                     }
1505 1519
                     else
1506 1520
                     {
1507 1521
                         imgCanvas.Source = null;
1522
+                        imgDocumentation.Source = null;
1508 1523
                     }
1509 1524
                 }
1510 1525
                 //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
@@ -1550,29 +1565,39 @@ namespace XHWK.WKTool
1550 1565
                     }
1551 1566
                     if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
1552 1567
                     {
1553
-                        //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
1554
-                        imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1555
-                        if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1568
+                        if(APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
1569
+                        {
1570
+                            imgCanvas.Source = null;
1571
+                            imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1572
+                        }
1573
+                        else
1556 1574
                         {
1557
-                            var group = IMG.FindResource("Imageview") as TransformGroup;
1558
-                            //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1559
-                            //{
1560
-                            //    var transform1 = group.Children[0] as ScaleTransform;
1561
-                            //    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1562
-                            //    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1563
-                            //}
1564
-                            var transform = group.Children[1] as TranslateTransform;
1565
-                            //var position = e.GetPosition(img);
1566
-                            transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1567
-                            transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1568
-
1569
-
1570
-                            mouseDown = false;
1575
+                            //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
1576
+                            imgDocumentation.Source = null;
1577
+                            imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1578
+                            if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1579
+                            {
1580
+                                var group = IMG.FindResource("Imageview") as TransformGroup;
1581
+                                //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1582
+                                //{
1583
+                                //    var transform1 = group.Children[0] as ScaleTransform;
1584
+                                //    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1585
+                                //    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1586
+                                //}
1587
+                                var transform = group.Children[1] as TranslateTransform;
1588
+                                //var position = e.GetPosition(img);
1589
+                                transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1590
+                                transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1591
+
1592
+
1593
+                                mouseDown = false;
1594
+                            }
1571 1595
                         }
1572 1596
                     }
1573 1597
                     else
1574 1598
                     {
1575 1599
                         imgCanvas.Source = null;
1600
+                        imgDocumentation.Source = null;
1576 1601
                     }
1577 1602
                 }
1578 1603
                 //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))

Loading…
取消
儲存