|
@@ -51,6 +51,14 @@ namespace XHWK.WKTool
|
51
|
51
|
/// 图片
|
52
|
52
|
/// </summary>
|
53
|
53
|
string[] ImgPDFPath = new string[300];
|
|
54
|
+ /// <summary>
|
|
55
|
+ /// 当前颜色
|
|
56
|
+ /// </summary>
|
|
57
|
+ private System.Windows.Media.Color Color = System.Windows.Media.Colors.Black;
|
|
58
|
+ /// <summary>
|
|
59
|
+ /// 笔迹粗细
|
|
60
|
+ /// </summary>
|
|
61
|
+ private int Size = 2;
|
54
|
62
|
#endregion
|
55
|
63
|
|
56
|
64
|
#region 初始化
|
|
@@ -62,11 +70,19 @@ namespace XHWK.WKTool
|
62
|
70
|
new Aspose.Pdf.License().SetLicense(new MemoryStream(Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGljZW5zZU5vdGU+CiAgICA8T3JkZXJJRD4xOTA4MjYwODA3NTM8L09yZGVySUQ+CiAgICA8VXNlcklEPjEzNDk3NjAwNjwvVXNlcklEPgogICAgPE9FTT5UaGlzIGlzIGEgcmVkaXN0cmlidXRhYmxlIGxpY2Vuc2U8L09FTT4KICAgIDxQcm9kdWN0cz4KICAgICAgPFByb2R1Y3Q+QXNwb3NlLlRvdGFsIGZvciAuTkVUPC9Qcm9kdWN0PgogICAgPC9Qcm9kdWN0cz4KICAgIDxFZGl0aW9uVHlwZT5FbnRlcnByaXNlPC9FZGl0aW9uVHlwZT4KICAgIDxTZXJpYWxOdW1iZXI+M2U0NGRlMzAtZmNkMi00MTA2LWIzNWQtNDZjNmEzNzE1ZmMyPC9TZXJpYWxOdW1iZXI+CiAgICA8U3Vic2NyaXB0aW9uRXhwaXJ5PjIwMjAwODI3PC9TdWJzY3JpcHRpb25FeHBpcnk+CiAgICA8TGljZW5zZVZlcnNpb24+My4wPC9MaWNlbnNlVmVyc2lvbj4KICAgIDxMaWNlbnNlSW5zdHJ1Y3Rpb25zPmh0dHBzOi8vcHVyY2hhc2UuYXNwb3NlLmNvbS9wb2xpY2llcy91c2UtbGljZW5zZTwvTGljZW5zZUluc3RydWN0aW9ucz4KICA8L0RhdGE+CiAgPFNpZ25hdHVyZT53UGJtNUt3ZTYvRFZXWFNIY1o4d2FiVEFQQXlSR0pEOGI3L00zVkV4YWZpQnd5U2h3YWtrNGI5N2c2eGtnTjhtbUFGY3J0c0cwd1ZDcnp6MytVYk9iQjRYUndTZWxsTFdXeXNDL0haTDNpN01SMC9jZUFxaVZFOU0rWndOQkR4RnlRbE9uYTFQajhQMzhzR1grQ3ZsemJLZFZPZXk1S3A2dDN5c0dqYWtaL1E9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=")));
|
63
|
71
|
InitializeComponent();
|
64
|
72
|
|
|
73
|
+ btnPrint.IsEnabled = false;
|
|
74
|
+
|
65
|
75
|
myblackboard = new BlackboardNew(blackboard_canvas);
|
66
|
76
|
APP.pageData.pagenum = 1;
|
67
|
77
|
APP.pageData.currpage = 1;
|
68
|
78
|
DataContext = APP.pageData;
|
69
|
79
|
|
|
80
|
+ //APP.SaveDraw();//画板模型第一页初始化
|
|
81
|
+ APP.PageDrawList = new List<Model_DrawData>();
|
|
82
|
+ Model_DrawData model_DrawData = new Model_DrawData();
|
|
83
|
+ model_DrawData.PageNum = APP.pageData.currpage;
|
|
84
|
+ APP.PageDrawList.Add(model_DrawData);
|
|
85
|
+
|
70
|
86
|
txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoType");
|
71
|
87
|
if (FileToolsCommon.GetConfigValue("IsSound").Equals("true"))
|
72
|
88
|
{
|
|
@@ -85,6 +101,7 @@ namespace XHWK.WKTool
|
85
|
101
|
/// </summary>
|
86
|
102
|
public void Initialize()
|
87
|
103
|
{
|
|
104
|
+ APP.CameraPosition = FileToolsCommon.GetConfigValue("CameraPosition");
|
88
|
105
|
//创建 DrawingAttributes 类的一个实例
|
89
|
106
|
drawingAttributes = new DrawingAttributes();
|
90
|
107
|
//将 InkCanvas 的 DefaultDrawingAttributes 属性的值赋成创建的 DrawingAttributes 类的对象的引用
|
|
@@ -93,6 +110,9 @@ namespace XHWK.WKTool
|
93
|
110
|
blackboard_canvas.UseCustomCursor = true;
|
94
|
111
|
drawingAttributes.FitToCurve = true;
|
95
|
112
|
drawingAttributes.IgnorePressure = false;
|
|
113
|
+ drawingAttributes.Width = Size;
|
|
114
|
+ drawingAttributes.Height = Size;
|
|
115
|
+ drawingAttributes.Color = Color;
|
96
|
116
|
blackboard_canvas.Cursor = System.Windows.Input.Cursors.Pen;
|
97
|
117
|
//wfhCamera.Visibility = Visibility.Hidden;
|
98
|
118
|
ImgPDFPath = null;
|
|
@@ -136,7 +156,6 @@ namespace XHWK.WKTool
|
136
|
156
|
if (CameraHelper.CameraDevices.Count > 0)
|
137
|
157
|
{
|
138
|
158
|
CameraHelper.SetCameraDevice(0);
|
139
|
|
- imgPlayer.Visibility = Visibility.Visible;
|
140
|
159
|
RbnOpen = new List<string>();
|
141
|
160
|
times = new System.Timers.Timer(200);//设置执行一次(false)还是一直执行(true)
|
142
|
161
|
times.AutoReset = true;//设置是否执行System.Timers.Timer.Elapsed事件
|
|
@@ -164,7 +183,47 @@ namespace XHWK.WKTool
|
164
|
183
|
if (!string.IsNullOrWhiteSpace(path))
|
165
|
184
|
{
|
166
|
185
|
RbnOpen.Add(path);
|
167
|
|
- imgPlayer.Source = new BitmapImage(new Uri(path));
|
|
186
|
+ imgPlayerRight.Visibility = Visibility.Visible;
|
|
187
|
+ /// < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
|
|
188
|
+ if ("1".Equals(APP.CameraPosition))
|
|
189
|
+ {
|
|
190
|
+ imgPlayerRight.Visibility = Visibility.Visible;
|
|
191
|
+ imgPlayerLeft.Visibility = Visibility.Collapsed;
|
|
192
|
+ imgPlayerRightUnder.Visibility = Visibility.Collapsed;
|
|
193
|
+ imgPlayerLeftUnder.Visibility = Visibility.Collapsed;
|
|
194
|
+ imgPlayerRight.Source = new BitmapImage(new Uri(path));
|
|
195
|
+ }
|
|
196
|
+ else if ("2".Equals(APP.CameraPosition))
|
|
197
|
+ {
|
|
198
|
+ imgPlayerRight.Visibility = Visibility.Collapsed;
|
|
199
|
+ imgPlayerLeft.Visibility = Visibility.Visible;
|
|
200
|
+ imgPlayerRightUnder.Visibility = Visibility.Collapsed;
|
|
201
|
+ imgPlayerLeftUnder.Visibility = Visibility.Collapsed;
|
|
202
|
+ imgPlayerLeft.Source = new BitmapImage(new Uri(path));
|
|
203
|
+ }
|
|
204
|
+ else if ("3".Equals(APP.CameraPosition))
|
|
205
|
+ {
|
|
206
|
+ imgPlayerRight.Visibility = Visibility.Collapsed;
|
|
207
|
+ imgPlayerLeft.Visibility = Visibility.Collapsed;
|
|
208
|
+ imgPlayerRightUnder.Visibility = Visibility.Visible;
|
|
209
|
+ imgPlayerLeftUnder.Visibility = Visibility.Collapsed;
|
|
210
|
+ imgPlayerRightUnder.Source = new BitmapImage(new Uri(path));
|
|
211
|
+ }
|
|
212
|
+ else if ("4".Equals(APP.CameraPosition))
|
|
213
|
+ {
|
|
214
|
+ imgPlayerRight.Visibility = Visibility.Collapsed;
|
|
215
|
+ imgPlayerLeft.Visibility = Visibility.Collapsed;
|
|
216
|
+ imgPlayerRightUnder.Visibility = Visibility.Collapsed;
|
|
217
|
+ imgPlayerLeftUnder.Visibility = Visibility.Visible;
|
|
218
|
+ imgPlayerLeftUnder.Source = new BitmapImage(new Uri(path));
|
|
219
|
+ }
|
|
220
|
+ else
|
|
221
|
+ {
|
|
222
|
+ imgPlayerLeft.Visibility = Visibility.Collapsed;
|
|
223
|
+ imgPlayerRightUnder.Visibility = Visibility.Collapsed;
|
|
224
|
+ imgPlayerLeftUnder.Visibility = Visibility.Collapsed;
|
|
225
|
+ imgPlayerRight.Source = new BitmapImage(new Uri(path));
|
|
226
|
+ }
|
168
|
227
|
}
|
169
|
228
|
}
|
170
|
229
|
I++;
|
|
@@ -184,7 +243,10 @@ namespace XHWK.WKTool
|
184
|
243
|
private void RbnTurnOff_Click(object sender, RoutedEventArgs e)
|
185
|
244
|
{
|
186
|
245
|
IsRbnOpen = false;
|
187
|
|
- imgPlayer.Visibility = Visibility.Hidden;
|
|
246
|
+ imgPlayerRight.Visibility = Visibility.Collapsed;
|
|
247
|
+ imgPlayerLeft.Visibility = Visibility.Collapsed;
|
|
248
|
+ imgPlayerRightUnder.Visibility = Visibility.Collapsed;
|
|
249
|
+ imgPlayerLeftUnder.Visibility = Visibility.Collapsed;
|
188
|
250
|
CameraHelper.CloseDevice();
|
189
|
251
|
I = 9999;
|
190
|
252
|
}
|
|
@@ -216,9 +278,9 @@ namespace XHWK.WKTool
|
216
|
278
|
APP.W_ScreenRecordingToolbarWindow.Initialize();
|
217
|
279
|
}
|
218
|
280
|
//显示在右下角
|
219
|
|
-
|
220
|
|
- APP.W_ScreenRecordingToolbarWindow.Left = PrimaryScreen.DESKTOP.Width - APP.W_ScreenRecordingToolbarWindow.Width - 10;
|
221
|
|
- APP.W_ScreenRecordingToolbarWindow.Top = PrimaryScreen.DESKTOP.Height - APP.W_ScreenRecordingToolbarWindow.Height - 160;
|
|
281
|
+ APP.W_ScreenRecordingToolbarWindow.WindowStartupLocation = WindowStartupLocation.Manual;
|
|
282
|
+ APP.W_ScreenRecordingToolbarWindow.Left = PrimaryScreen.DESKTOP.Width - APP.W_ScreenRecordingToolbarWindow.Width - 60;
|
|
283
|
+ APP.W_ScreenRecordingToolbarWindow.Top = PrimaryScreen.DESKTOP.Height - APP.W_ScreenRecordingToolbarWindow.Height - 30;
|
222
|
284
|
APP.W_ScreenRecordingToolbarWindow.Topmost = true;
|
223
|
285
|
APP.W_ScreenRecordingToolbarWindow.Show();
|
224
|
286
|
Hide();
|
|
@@ -377,8 +439,30 @@ namespace XHWK.WKTool
|
377
|
439
|
{
|
378
|
440
|
FileToolsCommon.SetConfigValue("IsSound", "false");
|
379
|
441
|
}
|
|
442
|
+ /// < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
|
|
443
|
+ if (rbnRight.IsChecked == true)
|
|
444
|
+ {
|
|
445
|
+ FileToolsCommon.SetConfigValue("CameraPosition", "1");
|
|
446
|
+ }
|
|
447
|
+ else if (rbnLeft.IsChecked == true)
|
|
448
|
+ {
|
|
449
|
+ FileToolsCommon.SetConfigValue("CameraPosition", "2");
|
|
450
|
+ }
|
|
451
|
+ else if (rbnRightUnder.IsChecked == true)
|
|
452
|
+ {
|
|
453
|
+ FileToolsCommon.SetConfigValue("CameraPosition", "3");
|
|
454
|
+ }
|
|
455
|
+ else if (rbnLeftUnder.IsChecked == true)
|
|
456
|
+ {
|
|
457
|
+ FileToolsCommon.SetConfigValue("CameraPosition", "4");
|
|
458
|
+ }
|
|
459
|
+ APP.CameraPosition = FileToolsCommon.GetConfigValue("CameraPosition");
|
380
|
460
|
GridMain.Visibility = Visibility.Visible;
|
381
|
461
|
gridSetUp.Visibility = Visibility.Collapsed;
|
|
462
|
+ imgPlayerRight.Visibility = Visibility.Collapsed;
|
|
463
|
+ imgPlayerLeft.Visibility = Visibility.Collapsed;
|
|
464
|
+ imgPlayerRightUnder.Visibility = Visibility.Collapsed;
|
|
465
|
+ imgPlayerLeftUnder.Visibility = Visibility.Collapsed;
|
382
|
466
|
}
|
383
|
467
|
/// <summary>
|
384
|
468
|
/// 设置事件
|
|
@@ -387,9 +471,34 @@ namespace XHWK.WKTool
|
387
|
471
|
/// <param name="e"></param>
|
388
|
472
|
private void BtnSetUp_Click(object sender, RoutedEventArgs e)
|
389
|
473
|
{
|
390
|
|
- GridMain.Visibility = Visibility.Collapsed;
|
391
|
|
- gridSetUp.Visibility = Visibility.Visible;
|
392
|
|
- txbStoragePath.Content = APP.WKData.WkPath;
|
|
474
|
+ if (APP.IsLoginType == false)
|
|
475
|
+ {
|
|
476
|
+ Login();
|
|
477
|
+ return;
|
|
478
|
+ }
|
|
479
|
+ if (!TxbRecordingWord.Text.Equals("暂停"))
|
|
480
|
+ {
|
|
481
|
+ GridMain.Visibility = Visibility.Collapsed;
|
|
482
|
+ gridSetUp.Visibility = Visibility.Visible;
|
|
483
|
+ txbStoragePath.Content = APP.WKData.WkPath;
|
|
484
|
+ /// < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
|
|
485
|
+ if ("1".Equals(APP.CameraPosition))
|
|
486
|
+ {
|
|
487
|
+ rbnRight.IsChecked = true;
|
|
488
|
+ }
|
|
489
|
+ else if ("2".Equals(APP.CameraPosition))
|
|
490
|
+ {
|
|
491
|
+ rbnLeft.IsChecked = true;
|
|
492
|
+ }
|
|
493
|
+ else if ("3".Equals(APP.CameraPosition))
|
|
494
|
+ {
|
|
495
|
+ rbnRightUnder.IsChecked = true;
|
|
496
|
+ }
|
|
497
|
+ else if ("4".Equals(APP.CameraPosition))
|
|
498
|
+ {
|
|
499
|
+ rbnLeftUnder.IsChecked = true;
|
|
500
|
+ }
|
|
501
|
+ }
|
393
|
502
|
}
|
394
|
503
|
/// <summary>
|
395
|
504
|
/// 设置 浏览事件
|
|
@@ -430,6 +539,7 @@ namespace XHWK.WKTool
|
430
|
539
|
//blackboard_canvas.DefaultDrawingAttributes = drawingAttributes;
|
431
|
540
|
////设置 DrawingAttributes 的 Color 属性设置颜色
|
432
|
541
|
drawingAttributes.Color = Colors.White;
|
|
542
|
+ Color = Colors.White;
|
433
|
543
|
}
|
434
|
544
|
/// <summary>
|
435
|
545
|
/// 画笔颜色事件 红色
|
|
@@ -441,6 +551,7 @@ namespace XHWK.WKTool
|
441
|
551
|
|
442
|
552
|
//设置 DrawingAttributes 的 Color 属性设置颜色
|
443
|
553
|
drawingAttributes.Color = Colors.Red;
|
|
554
|
+ Color = Colors.Red;
|
444
|
555
|
}
|
445
|
556
|
/// <summary>
|
446
|
557
|
/// 画笔颜色事件 灰色
|
|
@@ -450,6 +561,7 @@ namespace XHWK.WKTool
|
450
|
561
|
private void BtnGray_Click(object sender, RoutedEventArgs e)
|
451
|
562
|
{
|
452
|
563
|
drawingAttributes.Color = Colors.Gray;
|
|
564
|
+ Color = Colors.Gray;
|
453
|
565
|
}
|
454
|
566
|
/// <summary>
|
455
|
567
|
/// 画笔颜色事件 青色
|
|
@@ -459,6 +571,7 @@ namespace XHWK.WKTool
|
459
|
571
|
private void BtnCyanBlue_Click(object sender, RoutedEventArgs e)
|
460
|
572
|
{
|
461
|
573
|
drawingAttributes.Color = Colors.LimeGreen;
|
|
574
|
+ Color = Colors.LimeGreen;
|
462
|
575
|
}
|
463
|
576
|
/// <summary>
|
464
|
577
|
/// 画笔颜色事件 黄色
|
|
@@ -468,6 +581,7 @@ namespace XHWK.WKTool
|
468
|
581
|
private void BtnYellow_Click(object sender, RoutedEventArgs e)
|
469
|
582
|
{
|
470
|
583
|
drawingAttributes.Color = Colors.Gold;
|
|
584
|
+ Color = Colors.Gold;
|
471
|
585
|
}
|
472
|
586
|
/// <summary>
|
473
|
587
|
/// 画笔颜色事件 蓝色
|
|
@@ -477,6 +591,7 @@ namespace XHWK.WKTool
|
477
|
591
|
private void BtnBlue_Click(object sender, RoutedEventArgs e)
|
478
|
592
|
{
|
479
|
593
|
drawingAttributes.Color = Colors.DeepSkyBlue;
|
|
594
|
+ Color = Colors.DeepSkyBlue;
|
480
|
595
|
}
|
481
|
596
|
/// <summary>
|
482
|
597
|
/// 画笔粗细事件 细
|
|
@@ -487,6 +602,7 @@ namespace XHWK.WKTool
|
487
|
602
|
{
|
488
|
603
|
drawingAttributes.Width = 1;
|
489
|
604
|
drawingAttributes.Height = 1;
|
|
605
|
+ Size = 1;
|
490
|
606
|
}
|
491
|
607
|
/// <summary>
|
492
|
608
|
/// 画笔粗细事件 中
|
|
@@ -497,6 +613,7 @@ namespace XHWK.WKTool
|
497
|
613
|
{
|
498
|
614
|
drawingAttributes.Width = 3;
|
499
|
615
|
drawingAttributes.Height = 3;
|
|
616
|
+ Size = 3;
|
500
|
617
|
}
|
501
|
618
|
/// <summary>
|
502
|
619
|
/// 画笔粗细事件 粗
|
|
@@ -507,6 +624,7 @@ namespace XHWK.WKTool
|
507
|
624
|
{
|
508
|
625
|
drawingAttributes.Width = 5;
|
509
|
626
|
drawingAttributes.Height = 5;
|
|
627
|
+ Size = 5;
|
510
|
628
|
}
|
511
|
629
|
/// <summary>
|
512
|
630
|
/// 登陆事件
|
|
@@ -525,6 +643,8 @@ namespace XHWK.WKTool
|
525
|
643
|
if (APP.W_LoginWindow == null)
|
526
|
644
|
{
|
527
|
645
|
APP.W_LoginWindow = new LoginWindow();
|
|
646
|
+ APP.W_LoginWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
|
647
|
+ APP.W_LoginWindow.Owner = this;
|
528
|
648
|
|
529
|
649
|
}
|
530
|
650
|
else
|
|
@@ -535,10 +655,20 @@ namespace XHWK.WKTool
|
535
|
655
|
if (APP.IsLoginType)
|
536
|
656
|
{
|
537
|
657
|
txbLoginType.Text = APP.UserInfo.Username;
|
|
658
|
+
|
|
659
|
+ ImgMyMine.Visibility = Visibility.Visible;
|
|
660
|
+ ImgMyMineTwo.Visibility = Visibility.Collapsed;
|
|
661
|
+ ImgUpload.Visibility = Visibility.Visible;
|
|
662
|
+ ImgUploadTwo.Visibility = Visibility.Collapsed;
|
538
|
663
|
}
|
539
|
664
|
else
|
540
|
665
|
{
|
541
|
666
|
txbLoginType.Text = "未登录";
|
|
667
|
+
|
|
668
|
+ ImgMyMine.Visibility = Visibility.Collapsed;
|
|
669
|
+ ImgMyMineTwo.Visibility = Visibility.Visible;
|
|
670
|
+ ImgUpload.Visibility = Visibility.Collapsed;
|
|
671
|
+ ImgUploadTwo.Visibility = Visibility.Visible;
|
542
|
672
|
}
|
543
|
673
|
}
|
544
|
674
|
/// <summary>
|
|
@@ -585,10 +715,35 @@ namespace XHWK.WKTool
|
585
|
715
|
{
|
586
|
716
|
if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
|
587
|
717
|
{
|
588
|
|
- APP.JPaths[APP.pageData.currpage] = APP.ImgPath;
|
589
|
|
- if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
|
|
718
|
+ //APP.JPaths[APP.pageData.currpage]= APP.ImgPath;
|
|
719
|
+ //APP.JPaths[APP.pageData.currpage] = APP.ImgPath;
|
|
720
|
+ if (APP.PageDrawList.Count >= APP.pageData.currpage)
|
|
721
|
+ {
|
|
722
|
+ APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath = APP.ImgPath;//zxycs
|
|
723
|
+ APP.PageDrawList[APP.pageData.currpage - 1].PdfImagePath = APP.ImgPath;
|
|
724
|
+ }
|
|
725
|
+ else
|
590
|
726
|
{
|
591
|
|
- imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
|
|
727
|
+ Model_DrawData model_DrawData = new Model_DrawData();
|
|
728
|
+ model_DrawData.PageImagePath = APP.ImgPath;
|
|
729
|
+ model_DrawData.PdfImagePath = APP.ImgPath;
|
|
730
|
+ APP.PageDrawList.Add(model_DrawData);
|
|
731
|
+ }
|
|
732
|
+ //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
|
|
733
|
+ //{
|
|
734
|
+ // //imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
|
|
735
|
+ // imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage-1].PageImagePath));
|
|
736
|
+ //}
|
|
737
|
+ if (APP.PageDrawList.Count >= APP.pageData.currpage && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
|
|
738
|
+ {
|
|
739
|
+ //imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
|
|
740
|
+ imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
|
741
|
+ //btnOk.Visibility = Visibility.Visible;
|
|
742
|
+ //blackboard_canvas.Visibility = Visibility.Collapsed;
|
|
743
|
+
|
|
744
|
+ ImgPrint.Visibility = Visibility.Visible;//截图成功可打印
|
|
745
|
+ ImgPrintTwo.Visibility = Visibility.Collapsed;
|
|
746
|
+ btnPrint.IsEnabled = true;
|
592
|
747
|
}
|
593
|
748
|
}
|
594
|
749
|
}
|
|
@@ -652,6 +807,9 @@ namespace XHWK.WKTool
|
652
|
807
|
LogHelper.WriteErrLog("【导入(BtnImport_Click)" + ex.Message, ex);
|
653
|
808
|
}
|
654
|
809
|
}
|
|
810
|
+ /// <summary>
|
|
811
|
+ /// 导入文档
|
|
812
|
+ /// </summary>
|
655
|
813
|
private void OpenDialog()
|
656
|
814
|
{
|
657
|
815
|
result = ofd.ShowDialog();
|
|
@@ -663,7 +821,7 @@ namespace XHWK.WKTool
|
663
|
821
|
string filepath = ofd.FileName;
|
664
|
822
|
string path = ofd.SafeFileName.Replace(".ppt", "").Trim();
|
665
|
823
|
string type = ofd.SafeFileName.Replace(".ppt", "typezsygppt").Trim();
|
666
|
|
- if (type.Contains("typezsygppt"))
|
|
824
|
+ if (type.Contains("typezsygppt"))//ppt
|
667
|
825
|
{
|
668
|
826
|
try
|
669
|
827
|
{
|
|
@@ -674,7 +832,6 @@ namespace XHWK.WKTool
|
674
|
832
|
ppt.Save(path, Aspose.Slides.Export.SaveFormat.Pdf);
|
675
|
833
|
#endregion
|
676
|
834
|
|
677
|
|
-
|
678
|
835
|
#region PDF转图片
|
679
|
836
|
// 图片绝对路径集合
|
680
|
837
|
List<string> images = new List<string>();
|
|
@@ -711,9 +868,41 @@ namespace XHWK.WKTool
|
711
|
868
|
}
|
712
|
869
|
#endregion
|
713
|
870
|
|
714
|
|
- APP.Paths = images.ToArray();
|
715
|
|
- ImgPDFPath = images.ToArray();
|
716
|
|
- for (int i = 0; i < APP.Paths.Length; i++)
|
|
871
|
+ //APP.Paths = images.ToArray();
|
|
872
|
+ //ImgPDFPath = images.ToArray();
|
|
873
|
+
|
|
874
|
+ string[] page = images.ToArray();
|
|
875
|
+ if(page.Length>0)
|
|
876
|
+ {
|
|
877
|
+ APP.PageDrawList = null;
|
|
878
|
+ APP.PageDrawList = new List<Model_DrawData>();
|
|
879
|
+ }
|
|
880
|
+ for (int i = 0; i < page.Length; i++)//给画板模型加图片路径
|
|
881
|
+ {
|
|
882
|
+ if (APP.PageDrawList != null && APP.PageDrawList.Count > i)
|
|
883
|
+ {
|
|
884
|
+ APP.PageDrawList[i].PageImagePath = page[i]; //zxycs
|
|
885
|
+ APP.PageDrawList[i].PdfImagePath = page[i];
|
|
886
|
+ APP.PageDrawList[i].PageNum = i + 1;
|
|
887
|
+ }
|
|
888
|
+ else
|
|
889
|
+ {
|
|
890
|
+
|
|
891
|
+ Model_DrawData model_DrawData = new Model_DrawData();
|
|
892
|
+ model_DrawData.PageImagePath = page[i];
|
|
893
|
+ model_DrawData.PdfImagePath = page[i];
|
|
894
|
+ model_DrawData.PageNum = i + 1;
|
|
895
|
+ APP.PageDrawList.Add(model_DrawData);
|
|
896
|
+ }
|
|
897
|
+ ImgPrint.Visibility = Visibility.Visible;//导入成功可打印
|
|
898
|
+ ImgPrintTwo.Visibility = Visibility.Collapsed;
|
|
899
|
+ btnPrint.IsEnabled = true;
|
|
900
|
+ APP.SaveDraw();
|
|
901
|
+ }
|
|
902
|
+ myblackboard.clear();
|
|
903
|
+ APP.pageData.pagenum = 1;
|
|
904
|
+ APP.pageData.currpage = 1;
|
|
905
|
+ for (int i = 0; i < APP.PageDrawList.Count; i++)
|
717
|
906
|
{
|
718
|
907
|
APP.pageData.pagenum += 1;
|
719
|
908
|
}
|
|
@@ -721,9 +910,10 @@ namespace XHWK.WKTool
|
721
|
910
|
{
|
722
|
911
|
APP.pageData.pagenum -= 1;
|
723
|
912
|
}
|
724
|
|
- if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage < APP.Paths.Length)
|
|
913
|
+ if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage < APP.PageDrawList.Count)
|
725
|
914
|
{
|
726
|
|
- imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));
|
|
915
|
+ //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
|
|
916
|
+ imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));//给当前页面展示图片
|
727
|
917
|
}
|
728
|
918
|
else
|
729
|
919
|
{
|
|
@@ -735,14 +925,46 @@ namespace XHWK.WKTool
|
735
|
925
|
LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(OpenDialog PPT)" + ex.Message, ex);
|
736
|
926
|
}
|
737
|
927
|
}
|
738
|
|
- else
|
|
928
|
+ else//word
|
739
|
929
|
{
|
740
|
930
|
try
|
741
|
931
|
{
|
742
|
932
|
string paths = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
|
743
|
|
- APP.Paths = ConvertWordToImage(filepath, paths, "", 0, 0, null, 0).ToArray();
|
|
933
|
+ string[] page = ConvertWordToImage(filepath, paths, "", 0, 0, null, 0).ToArray();
|
|
934
|
+ //APP.Paths = page;//cs
|
|
935
|
+ //ImgPDFPath = page;
|
|
936
|
+ if (page.Length > 0)
|
|
937
|
+ {
|
|
938
|
+ APP.PageDrawList = null;
|
|
939
|
+ APP.PageDrawList = new List<Model_DrawData>();
|
|
940
|
+ }
|
|
941
|
+ for (int i = 0; i < page.Length; i++)//给画板模型加图片路径
|
|
942
|
+ {
|
|
943
|
+ if (APP.PageDrawList!=null&&APP.PageDrawList.Count > i)
|
|
944
|
+ {
|
|
945
|
+ APP.PageDrawList[i].PageImagePath = page[i]; //zxycs
|
|
946
|
+ APP.PageDrawList[i].PdfImagePath = page[i];
|
|
947
|
+ APP.PageDrawList[i].PageNum = i + 1;
|
|
948
|
+ }
|
|
949
|
+ else
|
|
950
|
+ {
|
|
951
|
+
|
|
952
|
+ Model_DrawData model_DrawData = new Model_DrawData();
|
|
953
|
+ model_DrawData.PageImagePath = page[i];
|
|
954
|
+ model_DrawData.PdfImagePath = page[i];
|
|
955
|
+ model_DrawData.PageNum = i + 1;
|
|
956
|
+ APP.PageDrawList.Add(model_DrawData);
|
|
957
|
+ }
|
|
958
|
+ ImgPrint.Visibility = Visibility.Visible;//导入成功可打印
|
|
959
|
+ ImgPrintTwo.Visibility = Visibility.Collapsed;
|
|
960
|
+ btnPrint.IsEnabled = true;
|
744
|
961
|
|
745
|
|
- for (int i = 0; i < APP.Paths.Length; i++)
|
|
962
|
+ APP.SaveDraw();
|
|
963
|
+ }
|
|
964
|
+ APP.pageData.pagenum = 1;
|
|
965
|
+ APP.pageData.currpage = 1;
|
|
966
|
+ //myblackboard.clear();
|
|
967
|
+ for (int i = 0; i < APP.PageDrawList.Count; i++)
|
746
|
968
|
{
|
747
|
969
|
APP.pageData.pagenum += 1;
|
748
|
970
|
}
|
|
@@ -750,9 +972,10 @@ namespace XHWK.WKTool
|
750
|
972
|
{
|
751
|
973
|
APP.pageData.pagenum -= 1;
|
752
|
974
|
}
|
753
|
|
- if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage < APP.Paths.Length)
|
|
975
|
+ if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage < APP.PageDrawList.Count)
|
754
|
976
|
{
|
755
|
|
- imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));
|
|
977
|
+ //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
|
|
978
|
+ imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));//给当前页面展示图片
|
756
|
979
|
}
|
757
|
980
|
else
|
758
|
981
|
{
|
|
@@ -853,6 +1076,36 @@ namespace XHWK.WKTool
|
853
|
1076
|
{
|
854
|
1077
|
if (IsSuspendR)
|
855
|
1078
|
{
|
|
1079
|
+ ImgPrint.Visibility = Visibility.Collapsed;//录制中不可打印
|
|
1080
|
+ ImgPrintTwo.Visibility = Visibility.Visible;
|
|
1081
|
+ btnPrint.IsEnabled = false;
|
|
1082
|
+
|
|
1083
|
+ ImgScreenshot.Visibility = Visibility.Collapsed;//录制中不可截图
|
|
1084
|
+ ImgScreenshotTwo.Visibility = Visibility.Visible;
|
|
1085
|
+ btnScreenshot.IsEnabled = false;
|
|
1086
|
+
|
|
1087
|
+ ImgImport.Visibility = Visibility.Collapsed;//录制中不可导入文档
|
|
1088
|
+ ImgImportTwo.Visibility = Visibility.Visible;
|
|
1089
|
+ btnImport.IsEnabled = false;
|
|
1090
|
+
|
|
1091
|
+ ImgScreenRecording.Visibility = Visibility.Collapsed;//录制中不可录屏
|
|
1092
|
+ ImgScreenRecordingTwo.Visibility = Visibility.Visible;
|
|
1093
|
+ btnScreenRecording.IsEnabled = false;
|
|
1094
|
+
|
|
1095
|
+ ImgUpload.Visibility = Visibility.Collapsed;//录制中不可上传
|
|
1096
|
+ ImgUploadTwo.Visibility = Visibility.Visible;
|
|
1097
|
+ btnUpload.IsEnabled = false;
|
|
1098
|
+
|
|
1099
|
+ ImgMyMine.Visibility = Visibility.Collapsed;//录制中不可点击我的
|
|
1100
|
+ ImgMyMineTwo.Visibility = Visibility.Visible;
|
|
1101
|
+ btnMyMine.IsEnabled = false;
|
|
1102
|
+
|
|
1103
|
+ ImgSetUp.Visibility = Visibility.Collapsed;//录制中不可设置
|
|
1104
|
+ ImgSetUpTwo.Visibility = Visibility.Visible;
|
|
1105
|
+ btnSetUp.IsEnabled = false;
|
|
1106
|
+
|
|
1107
|
+ btnLoginType.IsEnabled = false;
|
|
1108
|
+
|
856
|
1109
|
if (IsFirstR)//是否第一次录制 初始化录制
|
857
|
1110
|
{
|
858
|
1111
|
VideoInfo = new Model_Video();
|
|
@@ -986,6 +1239,35 @@ namespace XHWK.WKTool
|
986
|
1239
|
{
|
987
|
1240
|
if (!IsFirstR)
|
988
|
1241
|
{
|
|
1242
|
+ ImgPrint.Visibility = Visibility.Visible;
|
|
1243
|
+ ImgPrintTwo.Visibility = Visibility.Collapsed;
|
|
1244
|
+ btnPrint.IsEnabled = true;
|
|
1245
|
+
|
|
1246
|
+ ImgScreenshot.Visibility = Visibility.Visible;
|
|
1247
|
+ ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
|
1248
|
+ btnScreenshot.IsEnabled = true;
|
|
1249
|
+
|
|
1250
|
+ ImgImport.Visibility = Visibility.Visible;
|
|
1251
|
+ ImgImportTwo.Visibility = Visibility.Collapsed;
|
|
1252
|
+ btnImport.IsEnabled = true;
|
|
1253
|
+
|
|
1254
|
+ ImgScreenRecording.Visibility = Visibility.Visible;
|
|
1255
|
+ ImgScreenRecordingTwo.Visibility = Visibility.Collapsed;
|
|
1256
|
+ btnScreenRecording.IsEnabled = true;
|
|
1257
|
+
|
|
1258
|
+ ImgUpload.Visibility = Visibility.Visible;
|
|
1259
|
+ ImgUploadTwo.Visibility = Visibility.Collapsed;
|
|
1260
|
+ btnUpload.IsEnabled = true;
|
|
1261
|
+
|
|
1262
|
+ ImgMyMine.Visibility = Visibility.Visible;
|
|
1263
|
+ ImgMyMineTwo.Visibility = Visibility.Collapsed;
|
|
1264
|
+ btnMyMine.IsEnabled = true;
|
|
1265
|
+
|
|
1266
|
+ ImgSetUp.Visibility = Visibility.Visible;
|
|
1267
|
+ ImgSetUpTwo.Visibility = Visibility.Collapsed;
|
|
1268
|
+ btnSetUp.IsEnabled = true;
|
|
1269
|
+
|
|
1270
|
+ btnLoginType.IsEnabled = true;
|
989
|
1271
|
IsSuspendR = true;
|
990
|
1272
|
ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
|
991
|
1273
|
TxbRecordingWord.Text = "录制";
|
|
@@ -1057,10 +1339,25 @@ namespace XHWK.WKTool
|
1057
|
1339
|
Login();
|
1058
|
1340
|
return;
|
1059
|
1341
|
}
|
1060
|
|
- APP.pageData.pagenum += 1;
|
1061
|
|
- APP.pageData.currpage = APP.pageData.pagenum;
|
1062
|
|
- myblackboard.changepage(APP.pageData.currpage - 1);
|
1063
|
|
- imgCanvas.Source = null;
|
|
1342
|
+ if (APP.pageData.pagenum < 200)
|
|
1343
|
+ {
|
|
1344
|
+ if (APP.PageDrawList != null && APP.PageDrawList.Count > 0 && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
|
|
1345
|
+ {
|
|
1346
|
+ APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
|
1347
|
+ }
|
|
1348
|
+ APP.pageData.pagenum += 1;
|
|
1349
|
+ APP.pageData.currpage = APP.pageData.pagenum;
|
|
1350
|
+ myblackboard.changepage(APP.pageData.currpage - 1);
|
|
1351
|
+ imgCanvas.Source = null;
|
|
1352
|
+ Model_DrawData model_DrawData = new Model_DrawData();
|
|
1353
|
+ model_DrawData.PageNum = APP.pageData.currpage;
|
|
1354
|
+ APP.PageDrawList.Add(model_DrawData);
|
|
1355
|
+ APP.SaveDraw();//画板模型增加一页
|
|
1356
|
+ }
|
|
1357
|
+ else
|
|
1358
|
+ {
|
|
1359
|
+ System.Windows.Forms.MessageBox.Show("已达到最大页数无法继续增加!");
|
|
1360
|
+ }
|
1064
|
1361
|
}
|
1065
|
1362
|
/// <summary>
|
1066
|
1363
|
/// 打印事件
|
|
@@ -1083,23 +1380,24 @@ namespace XHWK.WKTool
|
1083
|
1380
|
|
1084
|
1381
|
|
1085
|
1382
|
////string[] files = { @"C:\101\1.jpg", @"C:\101\2.jpg" };
|
1086
|
|
- iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
|
|
1383
|
+
|
1087
|
1384
|
try
|
1088
|
1385
|
{
|
|
1386
|
+ iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
|
1089
|
1387
|
//iTextSharp.text.Rectangle page = new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.A4., 250f);//cs
|
1090
|
|
- //设置纸张横向
|
1091
|
|
- document.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
|
|
1388
|
+ ////设置纸张横向
|
|
1389
|
+ //document.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
|
1092
|
1390
|
|
1093
|
1391
|
|
1094
|
1392
|
iTextSharp.text.pdf.PdfWriter.GetInstance(document, new FileStream(@"G:\101.pdf", FileMode.Create, FileAccess.ReadWrite));
|
1095
|
1393
|
document.Open();
|
1096
|
1394
|
iTextSharp.text.Image image;
|
1097
|
|
- for (int i = 0; i < 10/*ImgPDFPath.Length*/; i++)
|
|
1395
|
+ for (int i = 0; i < APP.PageDrawList.Count; i++)
|
1098
|
1396
|
{
|
1099
|
|
- if (String.IsNullOrEmpty(ImgPDFPath[i])) break;
|
|
1397
|
+ if (String.IsNullOrEmpty(APP.PageDrawList[i].PdfImagePath)) break;
|
1100
|
1398
|
|
1101
|
1399
|
|
1102
|
|
- image = iTextSharp.text.Image.GetInstance(ImgPDFPath[i]);
|
|
1400
|
+ image = iTextSharp.text.Image.GetInstance(APP.PageDrawList[i].PdfImagePath);
|
1103
|
1401
|
|
1104
|
1402
|
|
1105
|
1403
|
if (image.Height > iTextSharp.text.PageSize.A4.Height - 25)
|
|
@@ -1127,24 +1425,38 @@ namespace XHWK.WKTool
|
1127
|
1425
|
}
|
1128
|
1426
|
//document.Close();
|
1129
|
1427
|
////Console.ReadKey();
|
1130
|
|
-
|
1131
|
|
- int pr = 1;
|
1132
|
|
- string msg = string.Empty;
|
1133
|
|
- string outPut = string.Empty;
|
1134
|
|
- LatticeFileHelper.GeneratingPDF(@"G:\101.pdf", @"G:\102.TPF", out pr, out msg, out outPut);
|
1135
|
|
- if (pr == 0)
|
|
1428
|
+ if (APP.W_PrintWindow == null)
|
1136
|
1429
|
{
|
1137
|
|
- outPut = outPut.Replace("[", "").Replace("]", "").Replace("\"", "").Trim();
|
1138
|
|
- APP.OutPut = outPut.Split(',');
|
1139
|
|
- string defa = string.Empty;
|
1140
|
|
- List<string> defaList = LatticeFileHelper.GetPrinterList(out defa);
|
|
1430
|
+ APP.W_PrintWindow = new PrintWindow();
|
|
1431
|
+ APP.W_PrintWindow.Topmost = true;
|
|
1432
|
+ APP.W_PrintWindow.Owner = this;
|
|
1433
|
+ }
|
|
1434
|
+ if (APP.PageDrawList.Count > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[0].PdfImagePath))
|
|
1435
|
+ {
|
|
1436
|
+ APP.W_PrintWindow.Initialize(APP.PageDrawList[0].PdfImagePath);
|
|
1437
|
+ }
|
|
1438
|
+ else
|
|
1439
|
+ {
|
|
1440
|
+ APP.W_PrintWindow.Initialize("");
|
|
1441
|
+ }
|
|
1442
|
+ APP.W_PrintWindow.Show();
|
|
1443
|
+ //int pr = 1;
|
|
1444
|
+ //string msg = string.Empty;
|
|
1445
|
+ //string outPut = string.Empty;
|
|
1446
|
+ //LatticeFileHelper.GeneratingPDF(@"G:\101.pdf", @"G:\102.TPF",out pr, out msg, out outPut);
|
|
1447
|
+ //if(pr==0)
|
|
1448
|
+ //{
|
|
1449
|
+ // outPut = outPut.Replace("[", "").Replace("]","").Replace("\"","").Trim();
|
|
1450
|
+ // APP.OutPut = outPut.Split(',');
|
|
1451
|
+ // string defa = string.Empty;
|
|
1452
|
+ // List<string>defaList= LatticeFileHelper.GetPrinterList(out defa);
|
1141
|
1453
|
|
1142
|
|
- int printResult = 1;
|
1143
|
|
- string standardError = string.Empty;
|
1144
|
|
- string standardOutput = string.Empty;
|
1145
|
|
- LatticeFileHelper.PrinterTPFFile(@"G:\102.TPF", 1, /*defa*/"导出为WPS PDF", out printResult, out standardError, out standardOutput);
|
|
1454
|
+ // int printResult = 1;
|
|
1455
|
+ // string standardError = string.Empty;
|
|
1456
|
+ // string standardOutput = string.Empty;
|
|
1457
|
+ // LatticeFileHelper.PrinterTPFFile(@"G:\102.TPF",1, /*defa*/"导出为WPS PDF", out printResult,out standardError,out standardOutput);
|
1146
|
1458
|
|
1147
|
|
- }
|
|
1459
|
+ //}
|
1148
|
1460
|
}
|
1149
|
1461
|
/// <summary>
|
1150
|
1462
|
/// 我的
|
|
@@ -1176,7 +1488,8 @@ namespace XHWK.WKTool
|
1176
|
1488
|
FileToolsCommon.CreateDirectory(filePath);
|
1177
|
1489
|
string filePathName = filePath + APP.pageData.currpage.ToString() + ".jpg";
|
1178
|
1490
|
ImageHelper.SaveUIToImage(GridMain, filePathName, (int)GridMain.ActualWidth, (int)GridMain.ActualHeight);
|
1179
|
|
- ImgPDFPath[APP.pageData.currpage - 1] = filePathName;
|
|
1491
|
+ //ImgPDFPath[APP.pageData.currpage - 1] = filePathName;
|
|
1492
|
+ APP.PageDrawList[APP.pageData.currpage - 1].PdfImagePath = filePathName;
|
1180
|
1493
|
});
|
1181
|
1494
|
}
|
1182
|
1495
|
catch (Exception ex)
|
|
@@ -1184,22 +1497,45 @@ namespace XHWK.WKTool
|
1184
|
1497
|
LogHelper.WriteErrLog("【XHMicroLessonSystemWindow】(last_button_Click)生成图片错误:" + ex.Message, ex);
|
1185
|
1498
|
}
|
1186
|
1499
|
APP.pageData.currpage -= 1;
|
|
1500
|
+
|
1187
|
1501
|
myblackboard.changepage(APP.pageData.currpage - 1);
|
1188
|
|
- if (APP.Paths.Length > 0)
|
|
1502
|
+ if (APP.PageDrawList.Count > 0)
|
1189
|
1503
|
{
|
1190
|
|
- if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage < APP.Paths.Length && APP.pageData.currpage > 0)
|
|
1504
|
+ if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
|
1191
|
1505
|
{
|
1192
|
|
- imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));
|
|
1506
|
+ APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
|
1507
|
+ }
|
|
1508
|
+ if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && APP.pageData.currpage > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
|
|
1509
|
+ {
|
|
1510
|
+ //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
|
|
1511
|
+
|
|
1512
|
+ imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
|
1513
|
+ if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
|
|
1514
|
+ {
|
|
1515
|
+ var group = IMG.FindResource("Imageview") as TransformGroup;
|
|
1516
|
+ var transform = group.Children[1] as TranslateTransform;
|
|
1517
|
+ //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
|
|
1518
|
+ //{
|
|
1519
|
+ // var transform1 = group.Children[0] as ScaleTransform;
|
|
1520
|
+ // transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
|
|
1521
|
+ // transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
|
|
1522
|
+ //}
|
|
1523
|
+ //var position = e.GetPosition(img);
|
|
1524
|
+ transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
|
|
1525
|
+ transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
|
|
1526
|
+ mouseDown = false;
|
|
1527
|
+
|
|
1528
|
+ }
|
1193
|
1529
|
}
|
1194
|
1530
|
else
|
1195
|
1531
|
{
|
1196
|
1532
|
imgCanvas.Source = null;
|
1197
|
1533
|
}
|
1198
|
1534
|
}
|
1199
|
|
- if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
|
1200
|
|
- {
|
1201
|
|
- imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
|
1202
|
|
- }
|
|
1535
|
+ //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
|
|
1536
|
+ //{
|
|
1537
|
+ // imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
|
|
1538
|
+ //}
|
1203
|
1539
|
}
|
1204
|
1540
|
|
1205
|
1541
|
}
|
|
@@ -1220,7 +1556,8 @@ namespace XHWK.WKTool
|
1220
|
1556
|
FileToolsCommon.CreateDirectory(filePath);
|
1221
|
1557
|
string filePathName = filePath + APP.pageData.currpage.ToString() + ".jpg";
|
1222
|
1558
|
ImageHelper.SaveUIToImage(GridMain, filePathName, (int)GridMain.ActualWidth, (int)GridMain.ActualHeight);
|
1223
|
|
- ImgPDFPath[APP.pageData.currpage - 1] = filePathName;
|
|
1559
|
+ //ImgPDFPath[APP.pageData.currpage - 1] = filePathName;
|
|
1560
|
+ APP.PageDrawList[APP.pageData.currpage - 1].PdfImagePath = filePathName;
|
1224
|
1561
|
});
|
1225
|
1562
|
}
|
1226
|
1563
|
catch (Exception ex)
|
|
@@ -1229,22 +1566,44 @@ namespace XHWK.WKTool
|
1229
|
1566
|
}
|
1230
|
1567
|
APP.pageData.currpage += 1;
|
1231
|
1568
|
myblackboard.changepage(APP.pageData.currpage - 1);
|
1232
|
|
- if (APP.Paths.Length > 0)
|
|
1569
|
+ if (APP.PageDrawList.Count > 0)
|
1233
|
1570
|
{
|
1234
|
1571
|
|
1235
|
|
- if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.Paths.Length)
|
|
1572
|
+ if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
|
|
1573
|
+ {
|
|
1574
|
+ APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
|
1575
|
+ }
|
|
1576
|
+ if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
|
1236
|
1577
|
{
|
1237
|
|
- imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));
|
|
1578
|
+ //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
|
|
1579
|
+ imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
|
1580
|
+ if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
|
|
1581
|
+ {
|
|
1582
|
+ var group = IMG.FindResource("Imageview") as TransformGroup;
|
|
1583
|
+ //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
|
|
1584
|
+ //{
|
|
1585
|
+ // var transform1 = group.Children[0] as ScaleTransform;
|
|
1586
|
+ // transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
|
|
1587
|
+ // transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
|
|
1588
|
+ //}
|
|
1589
|
+ var transform = group.Children[1] as TranslateTransform;
|
|
1590
|
+ //var position = e.GetPosition(img);
|
|
1591
|
+ transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
|
|
1592
|
+ transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+ mouseDown = false;
|
|
1596
|
+ }
|
1238
|
1597
|
}
|
1239
|
1598
|
else
|
1240
|
1599
|
{
|
1241
|
1600
|
imgCanvas.Source = null;
|
1242
|
1601
|
}
|
1243
|
1602
|
}
|
1244
|
|
- if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
|
1245
|
|
- {
|
1246
|
|
- imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
|
1247
|
|
- }
|
|
1603
|
+ //if (!string.IsNullOrWhiteSpace(APP.JPaths[APP.pageData.currpage]))
|
|
1604
|
+ //{
|
|
1605
|
+ // imgCanvas.Source = new BitmapImage(new Uri(APP.JPaths[APP.pageData.currpage]));
|
|
1606
|
+ //}
|
1248
|
1607
|
}
|
1249
|
1608
|
}
|
1250
|
1609
|
/// <summary>
|
|
@@ -1375,18 +1734,31 @@ namespace XHWK.WKTool
|
1375
|
1734
|
Domousemove(img, e);
|
1376
|
1735
|
}
|
1377
|
1736
|
}
|
|
1737
|
+ /// <summary>
|
|
1738
|
+ /// x y轴
|
|
1739
|
+ /// </summary>
|
|
1740
|
+ /// <param name="img"></param>
|
|
1741
|
+ /// <param name="e"></param>
|
1378
|
1742
|
private void Domousemove(ContentControl img, System.Windows.Input.MouseEventArgs e)
|
1379
|
1743
|
{
|
1380
|
1744
|
if (e.LeftButton != MouseButtonState.Pressed)
|
1381
|
1745
|
{
|
1382
|
1746
|
return;
|
1383
|
1747
|
}
|
|
1748
|
+ if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation)
|
|
1749
|
+ {
|
|
1750
|
+ return;
|
|
1751
|
+ }
|
1384
|
1752
|
var group = IMG.FindResource("Imageview") as TransformGroup;
|
1385
|
1753
|
var transform = group.Children[1] as TranslateTransform;
|
1386
|
1754
|
var position = e.GetPosition(img);
|
1387
|
1755
|
transform.X -= mouseXY.X - position.X;
|
1388
|
1756
|
transform.Y -= mouseXY.Y - position.Y;
|
1389
|
1757
|
mouseXY = position;
|
|
1758
|
+ APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation = new TranslateTransform();
|
|
1759
|
+ APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X = transform.X;
|
|
1760
|
+ APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y = transform.Y;
|
|
1761
|
+ //APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
|
1390
|
1762
|
}
|
1391
|
1763
|
private void IMG1_MouseWheel(object sender, MouseWheelEventArgs e)
|
1392
|
1764
|
{
|
|
@@ -1416,6 +1788,14 @@ namespace XHWK.WKTool
|
1416
|
1788
|
transform1.X = -1 * ((pointToContent.X * transform.ScaleX) - point.X);
|
1417
|
1789
|
transform1.Y = -1 * ((pointToContent.Y * transform.ScaleY) - point.Y);
|
1418
|
1790
|
//Console.WriteLine("transform.ScaleX = " + transform.ScaleX + "; transform.ScaleY = " + transform.ScaleY);
|
|
1791
|
+
|
|
1792
|
+ //APP.PageDrawList[APP.pageData.currpage - 1].ImageSize = new ScaleTransform();
|
|
1793
|
+ //APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX = transform.ScaleX;
|
|
1794
|
+ //APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY = transform.ScaleY;
|
|
1795
|
+ //APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation = new TranslateTransform();
|
|
1796
|
+ //APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X = transform1.X;
|
|
1797
|
+ //APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y = transform1.Y;
|
|
1798
|
+ //APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
|
1419
|
1799
|
}
|
1420
|
1800
|
#endregion
|
1421
|
1801
|
|
|
@@ -1514,6 +1894,60 @@ namespace XHWK.WKTool
|
1514
|
1894
|
//labPenSerial.Text = penSerial;
|
1515
|
1895
|
//labPenStatus.Text = "PenDown";
|
1516
|
1896
|
isPenDown = true;
|
|
1897
|
+
|
|
1898
|
+ Dispatcher.Invoke(new Action(() =>
|
|
1899
|
+ {
|
|
1900
|
+ for (int i = 0; i < APP.PageDrawList.Count; i++)
|
|
1901
|
+ {
|
|
1902
|
+ if (APP.PageDrawList[i].PageCode == penSerial)
|
|
1903
|
+ {
|
|
1904
|
+ if (i < APP.pageData.pagenum)
|
|
1905
|
+ {
|
|
1906
|
+ if (i < APP.pageData.currpage)
|
|
1907
|
+ {
|
|
1908
|
+ int num = APP.pageData.currpage - i;
|
|
1909
|
+ APP.pageData.currpage -= num;
|
|
1910
|
+ myblackboard.changepage(APP.pageData.currpage - 1);
|
|
1911
|
+ if (APP.PageDrawList.Count > 0)
|
|
1912
|
+ {
|
|
1913
|
+ if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && APP.pageData.currpage > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
|
|
1914
|
+ {
|
|
1915
|
+ //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
|
|
1916
|
+
|
|
1917
|
+ imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
|
1918
|
+ }
|
|
1919
|
+ else
|
|
1920
|
+ {
|
|
1921
|
+ imgCanvas.Source = null;
|
|
1922
|
+ }
|
|
1923
|
+ }
|
|
1924
|
+ }
|
|
1925
|
+ else
|
|
1926
|
+ {
|
|
1927
|
+ int num = i - APP.pageData.currpage;
|
|
1928
|
+ APP.pageData.currpage += num;
|
|
1929
|
+ myblackboard.changepage(APP.pageData.currpage - 1);
|
|
1930
|
+ if (APP.PageDrawList.Count > 0)
|
|
1931
|
+ {
|
|
1932
|
+
|
|
1933
|
+ if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
|
|
1934
|
+ {
|
|
1935
|
+ //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
|
|
1936
|
+ imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
|
1937
|
+ }
|
|
1938
|
+ else
|
|
1939
|
+ {
|
|
1940
|
+ imgCanvas.Source = null;
|
|
1941
|
+ }
|
|
1942
|
+ }
|
|
1943
|
+ }
|
|
1944
|
+ }
|
|
1945
|
+ return;
|
|
1946
|
+ }
|
|
1947
|
+ }
|
|
1948
|
+ //myblackboard.changepages(0, 0, true);
|
|
1949
|
+ //myblackboard.changepaget(0, 0, true, blackboard_canvas);
|
|
1950
|
+ }));
|
1517
|
1951
|
}
|
1518
|
1952
|
//myblackboard.changepages(0, 0, true);
|
1519
|
1953
|
}
|
|
@@ -1548,7 +1982,8 @@ namespace XHWK.WKTool
|
1548
|
1982
|
}
|
1549
|
1983
|
Dispatcher.Invoke(new Action(() =>
|
1550
|
1984
|
{
|
1551
|
|
- myblackboard.changepages(0, 0, true);
|
|
1985
|
+ //myblackboard.changepages(0, 0, true);
|
|
1986
|
+ myblackboard.changepages(0, 0, true, Color, Size);
|
1552
|
1987
|
}));
|
1553
|
1988
|
|
1554
|
1989
|
}
|
|
@@ -1685,7 +2120,8 @@ namespace XHWK.WKTool
|
1685
|
2120
|
|
1686
|
2121
|
Dispatcher.Invoke(new Action(() =>
|
1687
|
2122
|
{
|
1688
|
|
- myblackboard.changepages(testX, testY, false);
|
|
2123
|
+ //myblackboard.changepages(testX, testY,false);
|
|
2124
|
+ myblackboard.changepages(testX, testY, false, Color, Size);
|
1689
|
2125
|
}));
|
1690
|
2126
|
|
1691
|
2127
|
|
|
@@ -1765,5 +2201,16 @@ namespace XHWK.WKTool
|
1765
|
2201
|
else
|
1766
|
2202
|
Visibility = Visibility.Hidden;
|
1767
|
2203
|
}
|
|
2204
|
+ /// <summary>
|
|
2205
|
+ /// 位置确定
|
|
2206
|
+ /// </summary>
|
|
2207
|
+ /// <param name="sender"></param>
|
|
2208
|
+ /// <param name="e"></param>
|
|
2209
|
+ private void BtnOk_Click(object sender, RoutedEventArgs e)
|
|
2210
|
+ {
|
|
2211
|
+ //APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
|
2212
|
+ //btnOk.Visibility = Visibility.Collapsed;
|
|
2213
|
+ //blackboard_canvas.Visibility = Visibility.Visible;
|
|
2214
|
+ }
|
1768
|
2215
|
}
|
1769
|
2216
|
}
|