|
@@ -1409,17 +1409,6 @@ namespace XHWK.WKTool
|
1409
|
1409
|
/// <param name="e"></param>
|
1410
|
1410
|
private void BtnAdd_Click(object sender, RoutedEventArgs e)
|
1411
|
1411
|
{
|
1412
|
|
- // RectangleF rectangleF = new RectangleF();
|
1413
|
|
- // rectangleF.Width = (float)APP.PageDrawList[0].ImageSizes.CenterX;
|
1414
|
|
- // rectangleF.Height = (float)APP.PageDrawList[0].ImageSizes.CenterY;
|
1415
|
|
- // rectangleF.X= (float)APP.PageDrawList[0].ImageLocation.X;
|
1416
|
|
- // rectangleF.Y = (float)APP.PageDrawList[0].ImageLocation.Y;
|
1417
|
|
-
|
1418
|
|
- // //CESHI
|
1419
|
|
- //bool isImg= MergerImg(APP.PageDrawList[0].PageImagePath, @"G:\102H.jpg", rectangleF, out string errmsg);
|
1420
|
|
-
|
1421
|
|
-
|
1422
|
|
-
|
1423
|
1412
|
if (APP.pageData.currpage > 0)
|
1424
|
1413
|
{
|
1425
|
1414
|
APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
|
@@ -1439,10 +1428,13 @@ namespace XHWK.WKTool
|
1439
|
1428
|
model_DrawData.PageNum = APP.pageData.currpage;
|
1440
|
1429
|
APP.PageDrawList.Add(model_DrawData);
|
1441
|
1430
|
APP.SaveDraw();
|
1442
|
|
- ///截图可用
|
1443
|
|
- ImgScreenshot.Visibility = Visibility.Visible;
|
1444
|
|
- ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
1445
|
|
- btnScreenshot.IsEnabled = true;
|
|
1431
|
+ if (btnImport.IsEnabled == true)
|
|
1432
|
+ {
|
|
1433
|
+ ///截图可用
|
|
1434
|
+ ImgScreenshot.Visibility = Visibility.Visible;
|
|
1435
|
+ ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
|
1436
|
+ btnScreenshot.IsEnabled = true;
|
|
1437
|
+ }
|
1446
|
1438
|
}
|
1447
|
1439
|
/// <summary>
|
1448
|
1440
|
/// 打印事件
|
|
@@ -1472,7 +1464,7 @@ namespace XHWK.WKTool
|
1472
|
1464
|
{
|
1473
|
1465
|
long ii = Timestamp();
|
1474
|
1466
|
string directoryPath = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
|
1475
|
|
- string filePathOutPut = Path.Combine(directoryPath, string.Format("{0}{1}.jpg", ii, i));
|
|
1467
|
+ string filePathOutPut = Path.Combine(directoryPath, string.Format("print{0}{1}.jpg", ii, i));
|
1476
|
1468
|
RectangleF rectangleFs = new RectangleF();
|
1477
|
1469
|
MergerImg("", filePathOutPut, rectangleFs, out string errmsg);
|
1478
|
1470
|
image = iTextSharp.text.Image.GetInstance(filePathOutPut);
|
|
@@ -1556,9 +1548,9 @@ namespace XHWK.WKTool
|
1556
|
1548
|
//APP.W_PrintWindow.Topmost = true;
|
1557
|
1549
|
APP.W_PrintWindow.Owner = this;
|
1558
|
1550
|
}
|
1559
|
|
- if (APP.PageDrawList.Count > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[0].PdfImagePath))
|
|
1551
|
+ if (APP.PageDrawList.Count > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[0].PageImagePath))
|
1560
|
1552
|
{
|
1561
|
|
- APP.W_PrintWindow.Initialize(APP.PageDrawList[0].PdfImagePath);
|
|
1553
|
+ APP.W_PrintWindow.Initialize(APP.PageDrawList[0].PageImagePath);
|
1562
|
1554
|
}
|
1563
|
1555
|
else
|
1564
|
1556
|
{
|
|
@@ -1591,28 +1583,15 @@ namespace XHWK.WKTool
|
1591
|
1583
|
{
|
1592
|
1584
|
if (APP.pageData.currpage > 1)
|
1593
|
1585
|
{
|
1594
|
|
- try
|
1595
|
|
- {
|
1596
|
|
- Dispatcher.Invoke(() =>
|
1597
|
|
- {
|
1598
|
|
- string filePath = FileToolsCommon.GetFileAbsolutePath("/Data/" + APP.UserInfo.Username + "/pdfimagetemp/");
|
1599
|
|
- FileToolsCommon.CreateDirectory(filePath);
|
1600
|
|
- string filePathName = filePath + APP.pageData.currpage.ToString() + ".jpg";
|
1601
|
|
- ImageHelper.SaveUIToImage(GridMain, filePathName, (int)GridMain.ActualWidth, (int)GridMain.ActualHeight);
|
1602
|
|
- //ImgPDFPath[APP.pageData.currpage - 1] = filePathName;
|
1603
|
|
- APP.PageDrawList[APP.pageData.currpage - 1].PdfImagePath = filePathName;
|
1604
|
|
- });
|
1605
|
|
- }
|
1606
|
|
- catch (Exception ex)
|
1607
|
|
- {
|
1608
|
|
- LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(last_button_Click)生成图片错误:" + ex.Message, ex);
|
1609
|
|
- }
|
1610
|
1586
|
APP.pageData.currpage -= 1;
|
1611
|
1587
|
myblackboard.changepage(APP.pageData.currpage - 1);
|
1612
|
|
- ///截图可用
|
1613
|
|
- ImgScreenshot.Visibility = Visibility.Visible;
|
1614
|
|
- ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
1615
|
|
- btnScreenshot.IsEnabled = true;
|
|
1588
|
+ if (btnImport.IsEnabled == true)
|
|
1589
|
+ {
|
|
1590
|
+ ///截图可用
|
|
1591
|
+ ImgScreenshot.Visibility = Visibility.Visible;
|
|
1592
|
+ ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
|
1593
|
+ btnScreenshot.IsEnabled = true;
|
|
1594
|
+ }
|
1616
|
1595
|
if (APP.pageData.currpage <= APP.PageDrawList.Count)
|
1617
|
1596
|
{
|
1618
|
1597
|
if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
|
|
@@ -1640,6 +1619,7 @@ namespace XHWK.WKTool
|
1640
|
1619
|
{
|
1641
|
1620
|
var group = IMG.FindResource("Imageview") as TransformGroup;
|
1642
|
1621
|
var transform = group.Children[1] as TranslateTransform;
|
|
1622
|
+ #region 高低 缩放比例
|
1643
|
1623
|
if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
|
1644
|
1624
|
{
|
1645
|
1625
|
var transform1 = group.Children[0] as ScaleTransform;
|
|
@@ -1648,9 +1628,11 @@ namespace XHWK.WKTool
|
1648
|
1628
|
imgCanvas.Width = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterX;
|
1649
|
1629
|
imgCanvas.Height = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterY;
|
1650
|
1630
|
}
|
1651
|
|
- //var position = e.GetPosition(img);
|
|
1631
|
+ #endregion
|
|
1632
|
+ #region XY轴
|
1652
|
1633
|
transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
|
1653
|
1634
|
transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
|
|
1635
|
+ #endregion
|
1654
|
1636
|
mouseDown = false;
|
1655
|
1637
|
}
|
1656
|
1638
|
}
|
|
@@ -1662,7 +1644,6 @@ namespace XHWK.WKTool
|
1662
|
1644
|
}
|
1663
|
1645
|
}
|
1664
|
1646
|
}
|
1665
|
|
-
|
1666
|
1647
|
}
|
1667
|
1648
|
/// <summary>
|
1668
|
1649
|
/// 下一页
|
|
@@ -1673,31 +1654,17 @@ namespace XHWK.WKTool
|
1673
|
1654
|
{
|
1674
|
1655
|
if (APP.pageData.currpage < APP.pageData.pagenum)
|
1675
|
1656
|
{
|
1676
|
|
- try
|
1677
|
|
- {
|
1678
|
|
- Dispatcher.Invoke(() =>
|
1679
|
|
- {
|
1680
|
|
- string filePath = FileToolsCommon.GetFileAbsolutePath("/Data/" + APP.UserInfo.Username + "/pdfimagetemp/");
|
1681
|
|
- FileToolsCommon.CreateDirectory(filePath);
|
1682
|
|
- string filePathName = filePath + APP.pageData.currpage.ToString() + ".jpg";
|
1683
|
|
- ImageHelper.SaveUIToImage(GridMain, filePathName, (int)GridMain.ActualWidth, (int)GridMain.ActualHeight);
|
1684
|
|
- //ImgPDFPath[APP.pageData.currpage - 1] = filePathName;
|
1685
|
|
- APP.PageDrawList[APP.pageData.currpage - 1].PdfImagePath = filePathName;
|
1686
|
|
- });
|
1687
|
|
- }
|
1688
|
|
- catch (Exception ex)
|
1689
|
|
- {
|
1690
|
|
- LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(next_btn_Click)生成图片错误:" + ex.Message, ex);
|
1691
|
|
- }
|
1692
|
1657
|
APP.pageData.currpage += 1;
|
1693
|
1658
|
myblackboard.changepage(APP.pageData.currpage - 1);
|
1694
|
|
- ///截图可用
|
1695
|
|
- ImgScreenshot.Visibility = Visibility.Visible;
|
1696
|
|
- ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
1697
|
|
- btnScreenshot.IsEnabled = true;
|
|
1659
|
+ if (btnImport.IsEnabled == true)
|
|
1660
|
+ {
|
|
1661
|
+ ///截图可用
|
|
1662
|
+ ImgScreenshot.Visibility = Visibility.Visible;
|
|
1663
|
+ ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
|
1664
|
+ btnScreenshot.IsEnabled = true;
|
|
1665
|
+ }
|
1698
|
1666
|
if (APP.pageData.currpage <= APP.PageDrawList.Count)
|
1699
|
1667
|
{
|
1700
|
|
-
|
1701
|
1668
|
if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
|
1702
|
1669
|
{
|
1703
|
1670
|
APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
|
@@ -1714,14 +1681,13 @@ namespace XHWK.WKTool
|
1714
|
1681
|
}
|
1715
|
1682
|
else
|
1716
|
1683
|
{
|
1717
|
|
- //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
|
1718
|
1684
|
imgDocumentation.Source = null;
|
1719
|
|
-
|
1720
|
1685
|
imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
1721
|
1686
|
APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
|
1722
|
1687
|
if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
|
1723
|
1688
|
{
|
1724
|
1689
|
var group = IMG.FindResource("Imageview") as TransformGroup;
|
|
1690
|
+ #region 高低 缩放比例
|
1725
|
1691
|
if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
|
1726
|
1692
|
{
|
1727
|
1693
|
var transform1 = group.Children[0] as ScaleTransform;
|
|
@@ -1730,10 +1696,12 @@ namespace XHWK.WKTool
|
1730
|
1696
|
imgCanvas.Width = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterX;
|
1731
|
1697
|
imgCanvas.Height = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterY;
|
1732
|
1698
|
}
|
|
1699
|
+ #endregion
|
|
1700
|
+ #region 坐标XY轴
|
1733
|
1701
|
var transform = group.Children[1] as TranslateTransform;
|
1734
|
|
- //var position = e.GetPosition(img);
|
1735
|
1702
|
transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
|
1736
|
1703
|
transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
|
|
1704
|
+ #endregion
|
1737
|
1705
|
mouseDown = false;
|
1738
|
1706
|
}
|
1739
|
1707
|
}
|
|
@@ -1744,10 +1712,6 @@ namespace XHWK.WKTool
|
1744
|
1712
|
imgDocumentation.Source = null;
|
1745
|
1713
|
}
|
1746
|
1714
|
}
|
1747
|
|
- //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
|
1748
|
|
- //{
|
1749
|
|
- // imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
|
1750
|
|
- //}
|
1751
|
1715
|
}
|
1752
|
1716
|
}
|
1753
|
1717
|
/// <summary>
|
|
@@ -2179,11 +2143,14 @@ namespace XHWK.WKTool
|
2179
|
2143
|
//}
|
2180
|
2144
|
stroke.Clear();
|
2181
|
2145
|
}
|
2182
|
|
- Dispatcher.Invoke(new Action(() =>
|
|
2146
|
+ if (APP.pageData.currpage > 0)
|
2183
|
2147
|
{
|
2184
|
|
- //myblackboard.changepages(0, 0, true);
|
2185
|
|
- myblackboard.changepages(0, 0, true, Color, Size);
|
2186
|
|
- }));
|
|
2148
|
+ Dispatcher.Invoke(new Action(() =>
|
|
2149
|
+ {
|
|
2150
|
+ myblackboard.changepages(0, 0, true, Color, Size, APP.pageData.currpage - 1);
|
|
2151
|
+ }));
|
|
2152
|
+ }
|
|
2153
|
+
|
2187
|
2154
|
|
2188
|
2155
|
}
|
2189
|
2156
|
|
|
@@ -2316,12 +2283,15 @@ namespace XHWK.WKTool
|
2316
|
2283
|
double testX = (double)cx * PropW;
|
2317
|
2284
|
double testY = (double)cy * PropH;
|
2318
|
2285
|
//pageSerial //点阵IP地址 与打印的页面关联
|
2319
|
|
-
|
2320
|
|
- Dispatcher.Invoke(new Action(() =>
|
|
2286
|
+ if (APP.pageData.currpage > 0)
|
2321
|
2287
|
{
|
2322
|
|
- //myblackboard.changepages(testX, testY,false);
|
2323
|
|
- myblackboard.changepages(testX, testY, false, Color, Size);
|
2324
|
|
- }));
|
|
2288
|
+ Dispatcher.Invoke(new Action(() =>
|
|
2289
|
+ {
|
|
2290
|
+ //myblackboard.changepages(testX, testY,false);
|
|
2291
|
+ myblackboard.changepages(testX, testY, false, Color, Size, APP.pageData.currpage - 1);
|
|
2292
|
+ }));
|
|
2293
|
+ }
|
|
2294
|
+
|
2325
|
2295
|
|
2326
|
2296
|
|
2327
|
2297
|
////每3个点画一条曲线
|