Browse Source

zhao:解决冲突

tags/录制修改前
耀 4 years ago
parent
commit
58f5b0e8f5

+ 19
- 6
Common/system/ImageHelper.cs View File

467
                     break;
467
                     break;
468
             }
468
             }
469
 
469
 
470
-            //克隆位图对象的一部分。
471
-            System.Drawing.Rectangle cloneRect = new System.Drawing.Rectangle(left, top, right - left, bottom - top);
472
-            Bitmap cloneBitmap = bmp.Clone(cloneRect, bmp.PixelFormat);
473
-            bmp.Dispose();
474
-            //cloneBitmap.Save(@"d:\123.png", ImageFormat.Png);
475
-            return cloneBitmap;
470
+            if(right - left<=0)//zxyceshi
471
+            {
472
+                //克隆位图对象的一部分。
473
+                System.Drawing.Rectangle cloneRect = new System.Drawing.Rectangle(left, top, 1, bottom - top);
474
+                Bitmap cloneBitmap = bmp.Clone(cloneRect, bmp.PixelFormat);
475
+                bmp.Dispose();
476
+                //cloneBitmap.Save(@"d:\123.png", ImageFormat.Png);
477
+                return cloneBitmap;
478
+            }
479
+            else
480
+            {
481
+                //克隆位图对象的一部分。
482
+                System.Drawing.Rectangle cloneRect = new System.Drawing.Rectangle(left, top, right - left, bottom - top);
483
+                Bitmap cloneBitmap = bmp.Clone(cloneRect, bmp.PixelFormat);
484
+                bmp.Dispose();
485
+                //cloneBitmap.Save(@"d:\123.png", ImageFormat.Png);
486
+                return cloneBitmap;
487
+            }
488
+         
476
         }
489
         }
477
 
490
 
478
         /// <summary>
491
         /// <summary>

+ 2
- 0
XHWK.WKTool/FileDirectoryWindow.xaml.cs View File

143
                     DAL_Upload dAL_Upload = new DAL_Upload();
143
                     DAL_Upload dAL_Upload = new DAL_Upload();
144
                     if (dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid, out string ErrMessage))
144
                     if (dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid, out string ErrMessage))
145
                     {
145
                     {
146
+                        pageData.menuList[i].Visi = "Visible";
147
+                        pageData.menuList[i].Coll = "Collapsed";
146
                         MessageBox.Show("视频上传成功!");
148
                         MessageBox.Show("视频上传成功!");
147
                     }
149
                     }
148
                     else
150
                     else

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

163
                 times.Enabled = true; //启动计时器
163
                 times.Enabled = true; //启动计时器
164
 
164
 
165
                 IsRbnOpen = true;
165
                 IsRbnOpen = true;
166
+
167
+                string imgPath = FileToolsCommon.GetFileAbsolutePath("Temp/imgplayer");
168
+                FileToolsCommon.CreateDirectory(imgPath);
166
             }
169
             }
167
         }
170
         }
168
 
171
 
178
                         if (I > 10010)
181
                         if (I > 10010)
179
                         {
182
                         {
180
                             long time = Timestamp();
183
                             long time = Timestamp();
181
-                        string imgPath= FileToolsCommon.GetFileAbsolutePath("temp/imgplayer");
182
-                            FileToolsCommon.CreateFile(imgPath);
184
+                        string imgPath= FileToolsCommon.GetFileAbsolutePath("Temp/imgplayer");
183
                             //string FilePathName = ImgPath + RsImgName.Count + ".png";
185
                             //string FilePathName = ImgPath + RsImgName.Count + ".png";
184
                             string path = CameraHelper.CaptureImage(imgPath, time.ToString());
186
                             string path = CameraHelper.CaptureImage(imgPath, time.ToString());
185
                             if (!string.IsNullOrWhiteSpace(path))
187
                             if (!string.IsNullOrWhiteSpace(path))
705
                         imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
707
                         imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
706
                         //btnOk.Visibility = Visibility.Visible;
708
                         //btnOk.Visibility = Visibility.Visible;
707
                         //blackboard_canvas.Visibility = Visibility.Collapsed;
709
                         //blackboard_canvas.Visibility = Visibility.Collapsed;
708
-
710
+                        APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation = false;
709
                         ImgPrint.Visibility = Visibility.Visible;//截图成功可打印
711
                         ImgPrint.Visibility = Visibility.Visible;//截图成功可打印
710
                         ImgPrintTwo.Visibility = Visibility.Collapsed;
712
                         ImgPrintTwo.Visibility = Visibility.Collapsed;
711
                         btnPrint.IsEnabled = true;
713
                         btnPrint.IsEnabled = true;
849
                                     APP.PageDrawList[i].PageImagePath = page[i]; //zxycs
851
                                     APP.PageDrawList[i].PageImagePath = page[i]; //zxycs
850
                                     APP.PageDrawList[i].PdfImagePath = page[i];
852
                                     APP.PageDrawList[i].PdfImagePath = page[i];
851
                                     APP.PageDrawList[i].PageNum = i + 1;
853
                                     APP.PageDrawList[i].PageNum = i + 1;
854
+                                    APP.PageDrawList[i].ImgDocumentation = true;
852
                                 }
855
                                 }
853
                                 else
856
                                 else
854
                                 {
857
                                 {
857
                                     model_DrawData.PageImagePath = page[i];
860
                                     model_DrawData.PageImagePath = page[i];
858
                                     model_DrawData.PdfImagePath = page[i];
861
                                     model_DrawData.PdfImagePath = page[i];
859
                                     model_DrawData.PageNum = i + 1;
862
                                     model_DrawData.PageNum = i + 1;
863
+                                    model_DrawData.ImgDocumentation = true;
860
                                     APP.PageDrawList.Add(model_DrawData);
864
                                     APP.PageDrawList.Add(model_DrawData);
861
                                 }
865
                                 }
862
                                 ImgPrint.Visibility = Visibility.Visible;//导入成功可打印
866
                                 ImgPrint.Visibility = Visibility.Visible;//导入成功可打印
910
                                     APP.PageDrawList[i].PageImagePath = page[i]; //zxycs
914
                                     APP.PageDrawList[i].PageImagePath = page[i]; //zxycs
911
                                     APP.PageDrawList[i].PdfImagePath = page[i];
915
                                     APP.PageDrawList[i].PdfImagePath = page[i];
912
                                     APP.PageDrawList[i].PageNum = i + 1;
916
                                     APP.PageDrawList[i].PageNum = i + 1;
917
+                                    APP.PageDrawList[i].ImgDocumentation = true;
913
                                 }
918
                                 }
914
                                 else
919
                                 else
915
                                 {
920
                                 {
918
                                     model_DrawData.PageImagePath = page[i];
923
                                     model_DrawData.PageImagePath = page[i];
919
                                     model_DrawData.PdfImagePath = page[i];
924
                                     model_DrawData.PdfImagePath = page[i];
920
                                     model_DrawData.PageNum = i + 1;
925
                                     model_DrawData.PageNum = i + 1;
926
+                                    model_DrawData.ImgDocumentation = true;
921
                                     APP.PageDrawList.Add(model_DrawData);
927
                                     APP.PageDrawList.Add(model_DrawData);
922
                                 }
928
                                 }
923
                                 ImgPrint.Visibility = Visibility.Visible;//导入成功可打印
929
                                 ImgPrint.Visibility = Visibility.Visible;//导入成功可打印
1476
                 APP.pageData.currpage -= 1;
1482
                 APP.pageData.currpage -= 1;
1477
 
1483
 
1478
                 myblackboard.changepage(APP.pageData.currpage - 1);
1484
                 myblackboard.changepage(APP.pageData.currpage - 1);
1479
-                if (APP.PageDrawList.Count > 0)
1485
+                if (APP.pageData.currpage <= APP.PageDrawList.Count)
1480
                 {
1486
                 {
1481
                     if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
1487
                     if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
1482
                     {
1488
                     {
1486
                     {
1492
                     {
1487
                         //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
1493
                         //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
1488
 
1494
 
1489
-                        imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1490
-                        if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1495
+                        if (APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
1491
                         {
1496
                         {
1492
-                            var group = IMG.FindResource("Imageview") as TransformGroup;
1493
-                            var transform = group.Children[1] as TranslateTransform;
1494
-                            //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1495
-                            //{
1496
-                            //    var transform1 = group.Children[0] as ScaleTransform;
1497
-                            //    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1498
-                            //    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1499
-                            //}
1500
-                            //var position = e.GetPosition(img);
1501
-                            transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1502
-                            transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1503
-                            mouseDown = false;
1497
+                            imgCanvas.Source = null;
1498
+                            imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1499
+                        }
1500
+                        else
1501
+                        {
1502
+                            imgDocumentation.Source = null;
1503
+                            imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1504
+                      
1505
+                            if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1506
+                            {
1507
+                                var group = IMG.FindResource("Imageview") as TransformGroup;
1508
+                                var transform = group.Children[1] as TranslateTransform;
1509
+                                //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1510
+                                //{
1511
+                                //    var transform1 = group.Children[0] as ScaleTransform;
1512
+                                //    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1513
+                                //    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1514
+                                //}
1515
+                                //var position = e.GetPosition(img);
1516
+                                transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1517
+                                transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1518
+                                mouseDown = false;
1504
 
1519
 
1520
+                            }
1505
                         }
1521
                         }
1506
                     }
1522
                     }
1507
                     else
1523
                     else
1508
                     {
1524
                     {
1509
                         imgCanvas.Source = null;
1525
                         imgCanvas.Source = null;
1526
+                        imgDocumentation.Source = null;
1510
                     }
1527
                     }
1511
                 }
1528
                 }
1512
                 //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
1529
                 //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
1543
                 }
1560
                 }
1544
                 APP.pageData.currpage += 1;
1561
                 APP.pageData.currpage += 1;
1545
                 myblackboard.changepage(APP.pageData.currpage - 1);
1562
                 myblackboard.changepage(APP.pageData.currpage - 1);
1546
-                if (APP.PageDrawList.Count > 0)
1563
+                if (APP.pageData.currpage <= APP.PageDrawList.Count)
1547
                 {
1564
                 {
1548
 
1565
 
1549
                     if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
1566
                     if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
1552
                     }
1569
                     }
1553
                     if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
1570
                     if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
1554
                     {
1571
                     {
1555
-                        //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
1556
-                        imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1557
-                        if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1572
+                        if(APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
1558
                         {
1573
                         {
1559
-                            var group = IMG.FindResource("Imageview") as TransformGroup;
1560
-                            //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1561
-                            //{
1562
-                            //    var transform1 = group.Children[0] as ScaleTransform;
1563
-                            //    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1564
-                            //    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1565
-                            //}
1566
-                            var transform = group.Children[1] as TranslateTransform;
1567
-                            //var position = e.GetPosition(img);
1568
-                            transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1569
-                            transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1570
-
1571
-
1572
-                            mouseDown = false;
1574
+                            imgCanvas.Source = null;
1575
+                            imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1576
+                        }
1577
+                        else
1578
+                        {
1579
+                            //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
1580
+                            imgDocumentation.Source = null;
1581
+                            imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1582
+                            if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
1583
+                            {
1584
+                                var group = IMG.FindResource("Imageview") as TransformGroup;
1585
+                                //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
1586
+                                //{
1587
+                                //    var transform1 = group.Children[0] as ScaleTransform;
1588
+                                //    transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
1589
+                                //    transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
1590
+                                //}
1591
+                                var transform = group.Children[1] as TranslateTransform;
1592
+                                //var position = e.GetPosition(img);
1593
+                                transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
1594
+                                transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
1595
+
1596
+
1597
+                                mouseDown = false;
1598
+                            }
1573
                         }
1599
                         }
1574
                     }
1600
                     }
1575
                     else
1601
                     else
1576
                     {
1602
                     {
1577
                         imgCanvas.Source = null;
1603
                         imgCanvas.Source = null;
1604
+                        imgDocumentation.Source = null;
1578
                     }
1605
                     }
1579
                 }
1606
                 }
1580
                 //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
1607
                 //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))

Loading…
Cancel
Save