|
@@ -188,7 +188,7 @@ namespace XHWK.WKTool
|
188
|
188
|
if (I > 10010)
|
189
|
189
|
{
|
190
|
190
|
long time = Timestamp();
|
191
|
|
- string imgPath= FileToolsCommon.GetFileAbsolutePath("Temp/imgplayer");
|
|
191
|
+ string imgPath = FileToolsCommon.GetFileAbsolutePath("Temp/imgplayer");
|
192
|
192
|
//string FilePathName = ImgPath + RsImgName.Count + ".png";
|
193
|
193
|
string path = CameraHelper.CaptureImage(imgPath, time.ToString());
|
194
|
194
|
if (!string.IsNullOrWhiteSpace(path))
|
|
@@ -335,7 +335,7 @@ namespace XHWK.WKTool
|
335
|
335
|
TxbRecordScreenWord.Text = "录屏";
|
336
|
336
|
});
|
337
|
337
|
}))).Start();
|
338
|
|
-
|
|
338
|
+
|
339
|
339
|
}
|
340
|
340
|
|
341
|
341
|
/// <summary>
|
|
@@ -350,7 +350,7 @@ namespace XHWK.WKTool
|
350
|
350
|
Login();
|
351
|
351
|
return;
|
352
|
352
|
}
|
353
|
|
- if(APP.fileDirectoryWindow==null)
|
|
353
|
+ if (APP.fileDirectoryWindow == null)
|
354
|
354
|
{
|
355
|
355
|
APP.fileDirectoryWindow = new FileDirectoryWindow();
|
356
|
356
|
//APP.fileDirectoryWindow.Topmost = true;
|
|
@@ -715,7 +715,7 @@ namespace XHWK.WKTool
|
715
|
715
|
{
|
716
|
716
|
if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
|
717
|
717
|
{
|
718
|
|
- if(APP.pageData.currpage==0)
|
|
718
|
+ if (APP.pageData.currpage == 0)
|
719
|
719
|
{
|
720
|
720
|
APP.pageData.pagenum += 1;
|
721
|
721
|
APP.pageData.currpage = APP.pageData.pagenum;
|
|
@@ -928,21 +928,21 @@ namespace XHWK.WKTool
|
928
|
928
|
string paths = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
|
929
|
929
|
string[] page = ConvertWordToImage(filepath, paths, "", 0, 0, null, 0).ToArray();
|
930
|
930
|
int num = 0;
|
931
|
|
- for (int i = 0+ APP.pageData.pagenum; i < page.Length+ APP.pageData.pagenum; i++)//给画板模型加图片路径
|
|
931
|
+ for (int i = 0 + APP.pageData.pagenum; i < page.Length + APP.pageData.pagenum; i++)//给画板模型加图片路径
|
932
|
932
|
{
|
933
|
|
- if (APP.PageDrawList!=null&&APP.PageDrawList.Count > i)
|
|
933
|
+ if (APP.PageDrawList != null && APP.PageDrawList.Count > i)
|
934
|
934
|
{
|
935
|
|
- APP.PageDrawList[i].PageImagePath = page[i- APP.pageData.pagenum]; //zxycs
|
936
|
|
- APP.PageDrawList[i].PdfImagePath = page[i- APP.pageData.pagenum];
|
|
935
|
+ APP.PageDrawList[i].PageImagePath = page[i - APP.pageData.pagenum]; //zxycs
|
|
936
|
+ APP.PageDrawList[i].PdfImagePath = page[i - APP.pageData.pagenum];
|
937
|
937
|
APP.PageDrawList[i].PageNum = i + 1;
|
938
|
938
|
APP.PageDrawList[i].ImgDocumentation = true;
|
939
|
939
|
}
|
940
|
940
|
else
|
941
|
941
|
{
|
942
|
|
-
|
|
942
|
+
|
943
|
943
|
Model_DrawData model_DrawData = new Model_DrawData();
|
944
|
|
- model_DrawData.PageImagePath = page[i- APP.pageData.pagenum];
|
945
|
|
- model_DrawData.PdfImagePath = page[i- APP.pageData.pagenum];
|
|
944
|
+ model_DrawData.PageImagePath = page[i - APP.pageData.pagenum];
|
|
945
|
+ model_DrawData.PdfImagePath = page[i - APP.pageData.pagenum];
|
946
|
946
|
model_DrawData.PageNum = i + 1;
|
947
|
947
|
model_DrawData.ImgDocumentation = true;
|
948
|
948
|
APP.PageDrawList.Add(model_DrawData);
|
|
@@ -953,12 +953,12 @@ namespace XHWK.WKTool
|
953
|
953
|
APP.SaveDraw();
|
954
|
954
|
num++;
|
955
|
955
|
}
|
956
|
|
- if(num>0)
|
|
956
|
+ if (num > 0)
|
957
|
957
|
{
|
958
|
958
|
APP.pageData.currpage = APP.pageData.pagenum + 1;
|
959
|
959
|
APP.pageData.pagenum += num;
|
960
|
960
|
}
|
961
|
|
- if (APP.pageData.currpage>0 && APP.pageData.currpage < APP.PageDrawList.Count)
|
|
961
|
+ if (APP.pageData.currpage > 0 && APP.pageData.currpage < APP.PageDrawList.Count)
|
962
|
962
|
{
|
963
|
963
|
imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));//给当前页面展示图片
|
964
|
964
|
imgCanvas.Source = null;
|
|
@@ -1039,7 +1039,7 @@ namespace XHWK.WKTool
|
1039
|
1039
|
/// <param name="e"></param>
|
1040
|
1040
|
private void BtnRecord_Click(object sender, RoutedEventArgs e)
|
1041
|
1041
|
{
|
1042
|
|
- if(APP.pageData.currpage > 0)
|
|
1042
|
+ if (APP.pageData.currpage > 0)
|
1043
|
1043
|
{
|
1044
|
1044
|
blackboard_canvas.Visibility = Visibility.Visible;
|
1045
|
1045
|
}
|
|
@@ -1306,7 +1306,7 @@ namespace XHWK.WKTool
|
1306
|
1306
|
ImgSetUpTwo.Visibility = Visibility.Collapsed;
|
1307
|
1307
|
btnSetUp.IsEnabled = true;
|
1308
|
1308
|
|
1309
|
|
- btnLoginType.IsEnabled = true;
|
|
1309
|
+ btnLoginType.IsEnabled = true;
|
1310
|
1310
|
#endregion
|
1311
|
1311
|
|
1312
|
1312
|
IsSuspendR = true;
|
|
@@ -1326,9 +1326,17 @@ namespace XHWK.WKTool
|
1326
|
1326
|
#endregion
|
1327
|
1327
|
try
|
1328
|
1328
|
{
|
|
1329
|
+ //缩略图
|
|
1330
|
+ string ThumbnailPath = FileToolsCommon.GetDirectoryName(VideoSavePathName) + "ThumbnailPath/";
|
|
1331
|
+ FileToolsCommon.CreateDirectory(ThumbnailPath);
|
|
1332
|
+ //缩略图存储位置
|
|
1333
|
+ string ThumbnailPathName = ThumbnailPath + FileToolsCommon.GetIOFileNameNoExtension(VideoSavePathName) + ".JPG";
|
|
1334
|
+ int gridActWidth = (int)GridMain.ActualWidth;
|
|
1335
|
+ int gridActHeight = (int)GridMain.ActualHeight;
|
1329
|
1336
|
APP.FFmpeg.StopFFmpeg(AudioPathName);
|
1330
|
1337
|
new Thread(new ThreadStart(new Action(() =>
|
1331
|
1338
|
{
|
|
1339
|
+ //停止截图
|
1332
|
1340
|
while (APP.FFmpeg.myProcess != null)
|
1333
|
1341
|
{
|
1334
|
1342
|
Thread.Sleep(100);
|
|
@@ -1338,23 +1346,22 @@ namespace XHWK.WKTool
|
1338
|
1346
|
IsStartCount = false;
|
1339
|
1347
|
timer.Stop();
|
1340
|
1348
|
});
|
1341
|
|
- }))).Start();
|
1342
|
|
-
|
1343
|
|
- new Thread(new ThreadStart(new Action(() =>
|
1344
|
|
- {
|
1345
|
|
- while (APP.FFmpeg.myProcess != null)
|
|
1349
|
+ //}))).Start();
|
|
1350
|
+ //new Thread(new ThreadStart(new Action(() =>
|
|
1351
|
+ //{
|
|
1352
|
+ //判断音频是否存在 判断音频临时文件夹是否存在
|
|
1353
|
+ if (!FileToolsCommon.IsExistFile(AudioPathName))
|
1346
|
1354
|
{
|
1347
|
1355
|
Thread.Sleep(100);
|
1348
|
1356
|
}
|
1349
|
|
- }))).Start();
|
1350
|
|
- APP.FFmpeg.SynthesisVideo(ImgPath, AudioPathName, VideoSavePathName, 5, (int)GridMain.Width, (int)GridMain.Height);
|
1351
|
|
- //生成缩略图
|
1352
|
|
- string ThumbnailPath = FileToolsCommon.GetDirectoryName(VideoSavePathName) + "ThumbnailPath/";
|
1353
|
|
- FileToolsCommon.CreateDirectory(ThumbnailPath);
|
1354
|
|
- //缩略图存储位置
|
1355
|
|
- string ThumbnailPathName = ThumbnailPath + FileToolsCommon.GetIOFileNameNoExtension(VideoSavePathName) + ".JPG";
|
1356
|
|
- new Thread(new ThreadStart(new Action(() =>
|
1357
|
|
- {
|
|
1357
|
+ if (FileToolsCommon.IsExistDirectory(FileToolsCommon.GetDirectoryName(AudioPathName) + "temp/"))
|
|
1358
|
+ {
|
|
1359
|
+ Thread.Sleep(100);
|
|
1360
|
+ }
|
|
1361
|
+ APP.FFmpeg.SynthesisVideo(ImgPath, AudioPathName, VideoSavePathName, 5, gridActWidth, gridActHeight);
|
|
1362
|
+ //}))).Start();
|
|
1363
|
+ //new Thread(new ThreadStart(new Action(() =>
|
|
1364
|
+ //{
|
1358
|
1365
|
while (!FileToolsCommon.IsExistFile(VideoSavePathName))
|
1359
|
1366
|
{
|
1360
|
1367
|
Thread.Sleep(100);
|
|
@@ -1402,36 +1409,36 @@ namespace XHWK.WKTool
|
1402
|
1409
|
/// <param name="e"></param>
|
1403
|
1410
|
private void BtnAdd_Click(object sender, RoutedEventArgs e)
|
1404
|
1411
|
{
|
1405
|
|
- // RectangleF rectangleF = new RectangleF();
|
1406
|
|
- // rectangleF.Width = (float)APP.PageDrawList[0].ImageSizes.CenterX;
|
1407
|
|
- // rectangleF.Height = (float)APP.PageDrawList[0].ImageSizes.CenterY;
|
1408
|
|
- // rectangleF.X= (float)APP.PageDrawList[0].ImageLocation.X;
|
1409
|
|
- // rectangleF.Y = (float)APP.PageDrawList[0].ImageLocation.Y;
|
|
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;
|
1410
|
1417
|
|
1411
|
|
- // //CESHI
|
1412
|
|
- //bool isImg= MergerImg(APP.PageDrawList[0].PageImagePath, @"G:\102H.jpg", rectangleF, out string errmsg);
|
|
1418
|
+ // //CESHI
|
|
1419
|
+ //bool isImg= MergerImg(APP.PageDrawList[0].PageImagePath, @"G:\102H.jpg", rectangleF, out string errmsg);
|
1413
|
1420
|
|
1414
|
1421
|
|
1415
|
1422
|
|
1416
|
|
- if (APP.pageData.currpage>0)
|
1417
|
|
- {
|
1418
|
|
- APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
1419
|
|
- }
|
1420
|
|
- if(IsStartCount&& blackboard_canvas.Visibility == Visibility.Collapsed)
|
1421
|
|
- {
|
1422
|
|
- blackboard_canvas.Visibility = Visibility.Visible;
|
1423
|
|
- }
|
1424
|
|
- APP.pageData.pagenum += 1;
|
1425
|
|
- APP.pageData.currpage = APP.pageData.pagenum;
|
1426
|
|
- myblackboard.changepage(APP.pageData.currpage - 1);
|
1427
|
|
- ///清空页面图片UI
|
1428
|
|
- imgCanvas.Source = null;
|
|
1423
|
+ if (APP.pageData.currpage > 0)
|
|
1424
|
+ {
|
|
1425
|
+ APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
|
1426
|
+ }
|
|
1427
|
+ if (IsStartCount && blackboard_canvas.Visibility == Visibility.Collapsed)
|
|
1428
|
+ {
|
|
1429
|
+ blackboard_canvas.Visibility = Visibility.Visible;
|
|
1430
|
+ }
|
|
1431
|
+ APP.pageData.pagenum += 1;
|
|
1432
|
+ APP.pageData.currpage = APP.pageData.pagenum;
|
|
1433
|
+ myblackboard.changepage(APP.pageData.currpage - 1);
|
|
1434
|
+ ///清空页面图片UI
|
|
1435
|
+ imgCanvas.Source = null;
|
1429
|
1436
|
imgDocumentation.Source = null;
|
1430
|
|
- ///画板模型增加一页
|
1431
|
|
- Model_DrawData model_DrawData = new Model_DrawData();
|
1432
|
|
- model_DrawData.PageNum = APP.pageData.currpage;
|
1433
|
|
- APP.PageDrawList.Add(model_DrawData);
|
1434
|
|
- APP.SaveDraw();
|
|
1437
|
+ ///画板模型增加一页
|
|
1438
|
+ Model_DrawData model_DrawData = new Model_DrawData();
|
|
1439
|
+ model_DrawData.PageNum = APP.pageData.currpage;
|
|
1440
|
+ APP.PageDrawList.Add(model_DrawData);
|
|
1441
|
+ APP.SaveDraw();
|
1435
|
1442
|
///截图可用
|
1436
|
1443
|
ImgScreenshot.Visibility = Visibility.Visible;
|
1437
|
1444
|
ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
|
@@ -1450,7 +1457,7 @@ namespace XHWK.WKTool
|
1450
|
1457
|
|
1451
|
1458
|
|
1452
|
1459
|
|
1453
|
|
- iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
|
|
1460
|
+ iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
|
1454
|
1461
|
//iTextSharp.text.Rectangle page = new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.A4., 250f);//cs
|
1455
|
1462
|
////设置纸张横向
|
1456
|
1463
|
//document.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
|
|
@@ -1473,7 +1480,7 @@ namespace XHWK.WKTool
|
1473
|
1480
|
{
|
1474
|
1481
|
|
1475
|
1482
|
}
|
1476
|
|
- else if(APP.PageDrawList[i].ImgDocumentation==true)
|
|
1483
|
+ else if (APP.PageDrawList[i].ImgDocumentation == true)
|
1477
|
1484
|
{
|
1478
|
1485
|
image = iTextSharp.text.Image.GetInstance(APP.PageDrawList[i].PageImagePath);
|
1479
|
1486
|
}
|
|
@@ -1488,7 +1495,7 @@ namespace XHWK.WKTool
|
1488
|
1495
|
|
1489
|
1496
|
string msg = string.Empty;
|
1490
|
1497
|
bool isImg = MergerImg(APP.PageDrawList[i].PageImagePath, filePathOutPut, rectangleF, out msg);
|
1491
|
|
- if(isImg)
|
|
1498
|
+ if (isImg)
|
1492
|
1499
|
{
|
1493
|
1500
|
image = iTextSharp.text.Image.GetInstance(filePathOutPut);
|
1494
|
1501
|
}
|
|
@@ -1498,7 +1505,7 @@ namespace XHWK.WKTool
|
1498
|
1505
|
}
|
1499
|
1506
|
}
|
1500
|
1507
|
|
1501
|
|
-
|
|
1508
|
+
|
1502
|
1509
|
|
1503
|
1510
|
|
1504
|
1511
|
if (image.Height > iTextSharp.text.PageSize.A4.Height - 25)
|
|
@@ -1526,7 +1533,7 @@ namespace XHWK.WKTool
|
1526
|
1533
|
}
|
1527
|
1534
|
|
1528
|
1535
|
|
1529
|
|
-
|
|
1536
|
+
|
1530
|
1537
|
|
1531
|
1538
|
|
1532
|
1539
|
|
|
@@ -1697,7 +1704,7 @@ namespace XHWK.WKTool
|
1697
|
1704
|
}
|
1698
|
1705
|
if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
|
1699
|
1706
|
{
|
1700
|
|
- if(APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
|
|
1707
|
+ if (APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
|
1701
|
1708
|
{
|
1702
|
1709
|
imgCanvas.Source = null;
|
1703
|
1710
|
imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
|
@@ -1751,45 +1758,45 @@ namespace XHWK.WKTool
|
1751
|
1758
|
/// <param name="_rectangle">图片位置</param>
|
1752
|
1759
|
/// <param name="errmsg">错误消息</param>
|
1753
|
1760
|
/// <returns></returns>
|
1754
|
|
- private bool MergerImg(string _path,string _saveimg,RectangleF _rectangle, out string errmsg)
|
|
1761
|
+ private bool MergerImg(string _path, string _saveimg, RectangleF _rectangle, out string errmsg)
|
1755
|
1762
|
{
|
1756
|
1763
|
errmsg = null;
|
1757
|
1764
|
try
|
1758
|
1765
|
{
|
1759
|
1766
|
Bitmap bitmap = null;
|
1760
|
1767
|
|
1761
|
|
- //创建要显示的图片对象,根据参数的个数设置宽度
|
1762
|
|
- Bitmap backgroudImg = new Bitmap((int)gridM.ActualWidth, (int)gridM.ActualHeight);
|
|
1768
|
+ //创建要显示的图片对象,根据参数的个数设置宽度
|
|
1769
|
+ Bitmap backgroudImg = new Bitmap((int)gridM.ActualWidth, (int)gridM.ActualHeight);
|
1763
|
1770
|
Graphics g = Graphics.FromImage(backgroudImg);
|
1764
|
1771
|
//清除画布,背景设置为白色
|
1765
|
1772
|
g.Clear(System.Drawing.Color.White);
|
1766
|
1773
|
|
1767
|
|
- if(!string.IsNullOrWhiteSpace(_path))
|
|
1774
|
+ if (!string.IsNullOrWhiteSpace(_path))
|
1768
|
1775
|
{
|
1769
|
|
- bitmap = ImageHelper.ReadBitmapFile(_path);
|
|
1776
|
+ bitmap = ImageHelper.ReadBitmapFile(_path);
|
1770
|
1777
|
g.DrawImage(bitmap, _rectangle);
|
1771
|
1778
|
}
|
1772
|
1779
|
|
1773
|
1780
|
|
1774
|
1781
|
backgroudImg.Save(_saveimg);
|
1775
|
|
-
|
|
1782
|
+
|
1776
|
1783
|
g.Dispose();
|
1777
|
1784
|
backgroudImg.Dispose();
|
1778
|
|
- if(bitmap!=null)
|
|
1785
|
+ if (bitmap != null)
|
1779
|
1786
|
{
|
1780
|
1787
|
bitmap.Dispose();
|
1781
|
1788
|
}
|
1782
|
|
-
|
|
1789
|
+
|
1783
|
1790
|
GC.Collect();
|
1784
|
1791
|
return true;
|
1785
|
1792
|
}
|
1786
|
1793
|
catch (Exception ex)
|
1787
|
1794
|
{
|
1788
|
1795
|
errmsg = ex.Message;
|
1789
|
|
- LogHelper.WriteErrLog("【截图合成】(MergerImg)图片合成失败:" + ex.Message,ex);
|
|
1796
|
+ LogHelper.WriteErrLog("【截图合成】(MergerImg)图片合成失败:" + ex.Message, ex);
|
1790
|
1797
|
return false;
|
1791
|
1798
|
}
|
1792
|
|
-
|
|
1799
|
+
|
1793
|
1800
|
}
|
1794
|
1801
|
/// <summary>
|
1795
|
1802
|
/// 将Word文档转换为图片的方法(该方法基于第三方DLL),你可以像这样调用该方法: ConvertPDF2Image("F:\\PdfFile.doc", "F:\\",
|
|
@@ -2388,7 +2395,7 @@ namespace XHWK.WKTool
|
2388
|
2395
|
/// <param name="e"></param>
|
2389
|
2396
|
private void BtnShrink_Click(object sender, RoutedEventArgs e)
|
2390
|
2397
|
{
|
2391
|
|
- if(this.WindowState == WindowState.Minimized)
|
|
2398
|
+ if (this.WindowState == WindowState.Minimized)
|
2392
|
2399
|
{
|
2393
|
2400
|
this.WindowState = WindowState.Normal;
|
2394
|
2401
|
}
|
|
@@ -2402,7 +2409,7 @@ namespace XHWK.WKTool
|
2402
|
2409
|
/// </summary>
|
2403
|
2410
|
/// <param name="sender"></param>
|
2404
|
2411
|
/// <param name="e"></param>
|
2405
|
|
- private void BtnOk_Click(object sender, RoutedEventArgs e)
|
|
2412
|
+ private void BtnOk_Click(object sender, RoutedEventArgs e)
|
2406
|
2413
|
{
|
2407
|
2414
|
//APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
2408
|
2415
|
//btnOk.Visibility = Visibility.Collapsed;
|