Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/zxy' into zyy

# Conflicts:
#	XHWK.WKTool/App.config
#	XHWK.WKTool/App.cs
#	XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs
tags/录制修改前
耀 4 anni fa
parent
commit
9d0361f59c

+ 189
- 57
Common/system/BlackboardNew.cs Vedi File

@@ -68,7 +68,7 @@ namespace Common.system
68 68
         {
69 69
             init(canvas, _pencolor);
70 70
         }
71
-
71
+        DrawingAttributes drawingAttributes;
72 72
         private void init(InkCanvas canvas, Color _pencolor)
73 73
         {
74 74
             m_canvas = canvas;
@@ -79,7 +79,7 @@ namespace Common.system
79 79
             if (canvas != null)
80 80
             {
81 81
                 canvas.EditingMode = InkCanvasEditingMode.Ink;
82
-                DrawingAttributes drawingAttributes = new DrawingAttributes();
82
+                 drawingAttributes = new DrawingAttributes();
83 83
                 canvas.DefaultDrawingAttributes = drawingAttributes;
84 84
                 drawingAttributes.Width = pensize;
85 85
                 drawingAttributes.Height = pensize;
@@ -159,12 +159,12 @@ namespace Common.system
159 159
         }
160 160
 
161 161
         // public方法 笔
162
-        public void change_pen()
162
+        public void change_pen(Color _color) 
163 163
         {
164 164
             //this.type = ZPenType.Pen;
165 165
             DrawingAttributes drawingAttributes = new DrawingAttributes();
166 166
             m_canvas.DefaultDrawingAttributes = drawingAttributes;
167
-            drawingAttributes.Color = pencolor;
167
+            drawingAttributes.Color = _color;
168 168
             drawingAttributes.Width = pensize;
169 169
             drawingAttributes.Height = pensize;
170 170
             drawingAttributes.FitToCurve = true;
@@ -230,14 +230,22 @@ namespace Common.system
230 230
         // 清空
231 231
         public void clear()
232 232
         {
233
-            ZBBPage page = strokes_page_all[pagenum];
234
-            if (page != null)
235
-            {
236
-                m_canvas.Strokes.Clear();
237
-                page.lines_histoty.Clear();
238
-                page.lines.Clear();
239
-                page.lines.Add(new ZBBPageStep());
240
-            }
233
+     
234
+            ZBBPage page = new ZBBPage();
235
+            page.lines.Add(new ZBBPageStep());
236
+            page.lines = new List<ZBBPageStep>();
237
+            page.lines_histoty = new List<ZBBPageStep>();
238
+            strokes_page_all.Add(page);
239
+
240
+
241
+            //ZBBPage page = strokes_page_all[pagenum];
242
+            //    if (page != null)
243
+            //{
244
+            //    m_canvas.Strokes.Clear();
245
+            //    page.lines_histoty.Clear();
246
+            //    page.lines.Clear();
247
+            //    page.lines.Add(new ZBBPageStep());
248
+            //}
241 249
         }
242 250
 
243 251
         public void changepage(int mpagenum)
@@ -257,7 +265,7 @@ namespace Common.system
257 265
                 }
258 266
 
259 267
                 ZBBPage page = strokes_page_all[pagenum];
260
-                if (page != null)
268
+                if (page != null&& page.lines.Count>0)
261 269
                 {
262 270
                     if (page.lines.Last().lines_curr.Count > 0)
263 271
                     {
@@ -270,13 +278,10 @@ namespace Common.system
270 278
                     }
271 279
 
272 280
                     m_canvas.Strokes.Add(page.lines.Last().lines_curr);
273
-                    //StylusPoints stylusPoints = new StylusPoints();
274
-                    //stylusPoints.Add();
275
-                    //m_canvas.Strokes[0].StylusPoints.Add();
281
+
282
+
276 283
                     StrokeCollection strokes = new StrokeCollection();
277 284
                     StylusPointCollection stylusPoints = new StylusPointCollection();
278
-                    //stylusPoints.
279
-                    //Stroke stroke = new Stroke();
280 285
                     System.Windows.Input.StylusPointDescription stylusPointDescription = new StylusPointDescription();
281 286
                     StylusPoint stylusPoint = new StylusPoint();
282 287
                     stylusPoint.X = 580;
@@ -289,30 +294,36 @@ namespace Common.system
289 294
                     stylusPoints.Add(stylusPoint);
290 295
                     stroke = new Stroke(stylusPoints);
291 296
 
292
-                    stylusPoint.X = 586;
293
-                    stylusPoint.Y = 214;
294
-                    stylusPoints.Add(stylusPoint);
295
-                    stroke = new Stroke(stylusPoints);
296
-
297
-                    stylusPoint.X = 599;
298
-                    stylusPoint.Y = 214;
299
-                    stylusPoints.Add(stylusPoint);
300
-                    stroke = new Stroke(stylusPoints);
301
-                    stylusPoint.X = 623;
302
-                    stylusPoint.Y = 214;
303
-                    stylusPoints.Add(stylusPoint);
304
-                    stroke = new Stroke(stylusPoints);
305
-
306
-                    stylusPoint.X = 663;
307
-                    stylusPoint.Y = 214;
308
-                    stylusPoints.Add(stylusPoint);
309
-                    stroke = new Stroke(stylusPoints);
310
-                    stylusPoint.X = 963;
311
-                    stylusPoint.Y = 214;
312
-                    stylusPoints.Add(stylusPoint);
313
-                    stroke = new Stroke(stylusPoints);
314
-                    //page.lines.Last().lines_curr.Add();
315
-
297
+                    //stylusPoint.X = 586;
298
+                    //stylusPoint.Y = 214;
299
+                    //stylusPoints.Add(stylusPoint);
300
+                    //stroke = new Stroke(stylusPoints);
301
+
302
+                    //stylusPoint.X = 599;
303
+                    //stylusPoint.Y = 214;
304
+                    //stylusPoints.Add(stylusPoint);
305
+                    //stroke = new Stroke(stylusPoints);
306
+                    //stylusPoint.X = 623;
307
+                    //stylusPoint.Y = 214;
308
+                    //stylusPoints.Add(stylusPoint);
309
+                    //stroke = new Stroke(stylusPoints);
310
+
311
+                    //stylusPoint.X = 663;
312
+                    //stylusPoint.Y = 214;
313
+                    //stylusPoints.Add(stylusPoint);
314
+                    //stroke = new Stroke(stylusPoints);
315
+                    //stylusPoint.X = 963;
316
+                    //stylusPoint.Y = 214;
317
+                    //stylusPoints.Add(stylusPoint);
318
+                    //stroke = new Stroke(stylusPoints);
319
+                    //DrawingAttributes drawingAttributes = new DrawingAttributes();
320
+                    //m_canvas.DefaultDrawingAttributes = drawingAttributes;
321
+                    //drawingAttributes.Color = Colors.Red;
322
+                    //drawingAttributes.Width = pensize;
323
+                    //drawingAttributes.Height = pensize;
324
+                    //drawingAttributes.FitToCurve = true;
325
+                    //drawingAttributes.IgnorePressure = false;
326
+                    //stroke.DrawingAttributes = drawingAttributes;
316 327
                     m_canvas.Strokes.Add(stroke);
317 328
                 }
318 329
             }
@@ -320,20 +331,93 @@ namespace Common.system
320 331
         StylusPointCollection stylusPoints = new StylusPointCollection();
321 332
         StylusPoint stylusPoint = new StylusPoint();
322 333
         Stroke stroke;
323
-        public void changepages(double _x, double _y, bool _new)
334
+        bool isFirst = true;
335
+        //public void changepages(double _x, double _y, bool _new, Color _color, int _size)
336
+        //{
337
+        //    if (_new)
338
+        //    {
339
+        //        if (stroke != null && stroke.StylusPoints.Count > 1)
340
+        //        {
341
+        //             drawingAttributes = new DrawingAttributes();
342
+        //            //m_canvas.DefaultDrawingAttributes = drawingAttributes;
343
+        //            drawingAttributes.Color = _color;
344
+        //            drawingAttributes.Width = _size;
345
+        //            drawingAttributes.Height = _size;
346
+        //            drawingAttributes.FitToCurve = true;
347
+        //            drawingAttributes.IgnorePressure = false;
348
+        //            stroke.DrawingAttributes = drawingAttributes;
349
+        //            m_canvas.Strokes.Add(stroke);
350
+        //            isFirst = true;
351
+        //        }
352
+
353
+        //        stylusPoints = new StylusPointCollection();
354
+        //        stylusPoint = new StylusPoint();
355
+        //        //stroke = new Stroke(stylusPoints);
356
+        //        stroke = null;
357
+        //    }
358
+        //    else
359
+        //    {
360
+        //        if(isFirst)
361
+        //        {
362
+        //            stylusPoint.X = _x;
363
+        //            stylusPoint.Y = _y;
364
+        //            stylusPoints.Add(stylusPoint);
365
+        //            if (stylusPoints.Count>1)
366
+        //            {
367
+        //                stroke = new Stroke(stylusPoints);
368
+        //                m_canvas.Strokes.Add(stroke);
369
+        //                isFirst = false;
370
+        //            }
371
+        //        }
372
+        //        else
373
+        //        {
374
+        //            stylusPoint.X = _x;
375
+        //            stylusPoint.Y = _y;
376
+        //            stylusPoints.Add(stylusPoint);
377
+        //            stroke = new Stroke(stylusPoints);
378
+        //            m_canvas.Strokes[m_canvas.Strokes.Count - 1].StylusPoints.Add(stylusPoints);
379
+        //        }
380
+        //    }
381
+        //}
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+        public void changepages(double _x, double _y, bool _new, Color _color, int _size)
324 399
         {
325 400
             if (_new)
326 401
             {
327
-                if(stroke!=null&&stroke.StylusPoints.Count > 1)
402
+                if (stroke != null && stroke.StylusPoints.Count > 1)
328 403
                 {
404
+                    drawingAttributes = new DrawingAttributes();
405
+                    //m_canvas.DefaultDrawingAttributes = drawingAttributes;
406
+                    drawingAttributes.Color = _color;
407
+                    drawingAttributes.Width = _size*5;
408
+                    drawingAttributes.Height = _size*5;
409
+                    drawingAttributes.FitToCurve = true;
410
+                    drawingAttributes.IgnorePressure = false;
411
+
412
+                    stroke.DrawingAttributes = drawingAttributes;
413
+                    //m_canvas.DefaultDrawingAttributes= drawingAttributes;
329 414
                     m_canvas.Strokes.Add(stroke);
330
-                   
331 415
                 }
332
-            
416
+
333 417
                 stylusPoints = new StylusPointCollection();
334 418
                 stylusPoint = new StylusPoint();
335 419
                 //stroke = new Stroke(stylusPoints);
336
-                stroke=null;
420
+                //stroke = null;
337 421
             }
338 422
             else
339 423
             {
@@ -344,16 +428,64 @@ namespace Common.system
344 428
                 stylusPoints.Add(stylusPoint);
345 429
                 stroke = new Stroke(stylusPoints);
346 430
             }
347
-           
348
-
349
-            //page.lines.Last().lines_curr.Add();
350
-            //if (stroke.StylusPoints.Count > 20)
351
-            //{
352
-              
353
-            
354
-
355
-
356
-
357 431
         }
432
+        ////声明一个 DrawingAttributes 类型的变量  
433
+        //DrawingAttributes drawingAttributes;
434
+        //public void changepaget(double _x, double _y, bool _new,InkCanvas canvas) 
435
+        //{
436
+        //    if (_new)
437
+        //    {
438
+        //        if (stroke != null && stroke.StylusPoints.Count > 1)
439
+        //        {
440
+        //            //m_canvas.Strokes.Add(stroke);
441
+        //            DrawingAttributes drawingAttributes = new DrawingAttributes();
442
+        //            canvas.DefaultDrawingAttributes = drawingAttributes;
443
+        //            drawingAttributes.Width = pensize;
444
+        //            drawingAttributes.Height = pensize;
445
+        //            drawingAttributes.Color = Colors.Red;
446
+        //            drawingAttributes.FitToCurve = true;
447
+        //            drawingAttributes.IgnorePressure = false;
448
+        //            canvas.DefaultDrawingAttributes = drawingAttributes;
449
+        //            canvas.Strokes.Add(stroke);
450
+
451
+        //            ZBBPage page = strokes_page_all[pagenum];
452
+        //            if (page != null)
453
+        //            {
454
+        //                step.lines_curr.Add(m_canvas.Strokes);
455
+        //                page.lines.Add(step);
456
+        //                step = null;
457
+        //            }
458
+        //        }
459
+
460
+        //        stylusPoints = new StylusPointCollection();
461
+        //        stylusPoint = new StylusPoint();
462
+        //        //stroke = new Stroke(stylusPoints);
463
+        //        stroke = null;
464
+        //    }
465
+        //    else
466
+        //    {
467
+        //       change_pen(Colors.Red);
468
+        //        //stylusPoints = new StylusPointCollection();
469
+        //        //stylusPoint = new StylusPoint();
470
+        //        stylusPoint.X = _x;
471
+        //        stylusPoint.Y = _y;
472
+        //        stylusPoints.Add(stylusPoint);
473
+        //        stroke = new Stroke(stylusPoints);
474
+        //        //m_canvas.
475
+
476
+        //        //page.lines.Last().lines_curr
477
+
478
+        //    }
479
+
480
+
481
+        //    //page.lines.Last().lines_curr.Add();
482
+        //    //if (stroke.StylusPoints.Count > 20)
483
+        //    //{
484
+
485
+
486
+
487
+
488
+
489
+        //}
358 490
     }
359 491
 }

+ 26
- 10
XHWK.Model/Model_DrawData.cs Vedi File

@@ -4,6 +4,7 @@ using System.Drawing;
4 4
 using System.Linq;
5 5
 using System.Text;
6 6
 using System.Threading.Tasks;
7
+using System.Windows.Media;
7 8
 
8 9
 namespace XHWK.Model
9 10
 {
@@ -15,11 +16,14 @@ namespace XHWK.Model
15 16
         private int _PageNum;
16 17
         private string _pageCode;
17 18
         private string _pageImagePath;
18
-        private PointF _ImageLocation;
19
-        private SizeF _ImageSize;
20
-        private string _PenColor;
21
-        private int _PenWigth;
19
+        private TranslateTransform _ImageLocation;
20
+        private ScaleTransform _ImageSize;
21
+        private bool _IsImageLocation;
22
+        //private string _PenColor;
23
+        //private int _PenWigth;
22 24
         //private List<PointF> _Handwriting;
25
+        private string _pdfImagePath;
26
+        private bool _imgDocumentation;
23 27
         /// <summary>
24 28
         /// 页码
25 29
         /// </summary>
@@ -35,19 +39,31 @@ namespace XHWK.Model
35 39
         /// <summary>
36 40
         /// 图片坐标
37 41
         /// </summary>
38
-        public PointF ImageLocation { get => _ImageLocation; set => _ImageLocation = value; }
42
+        public TranslateTransform ImageLocation { get => _ImageLocation; set => _ImageLocation = value; }
39 43
         /// <summary>
40 44
         /// 图片大小
41 45
         /// </summary>
42
-        public SizeF ImageSize { get => _ImageSize; set => _ImageSize = value; }
46
+        public ScaleTransform ImageSize { get => _ImageSize; set => _ImageSize = value; }
43 47
         /// <summary>
44
-        /// 笔颜色 十六进制
48
+        /// PDF 图片路径
45 49
         /// </summary>
46
-        public string PenColor { get => _PenColor; set => _PenColor = value; }
50
+        public string PdfImagePath { get => _pdfImagePath; set => _pdfImagePath = value; }
47 51
         /// <summary>
48
-        /// 线宽
52
+        /// 坐标是否固定
49 53
         /// </summary>
50
-        public int PenWigth { get => _PenWigth; set => _PenWigth = value; }
54
+        public bool IsImageLocation { get => _IsImageLocation; set => _IsImageLocation = value; }
55
+        /// <summary>
56
+        /// true 文档图片  folse 截图图片
57
+        /// </summary>
58
+        public bool ImgDocumentation { get => _imgDocumentation; set => _imgDocumentation = value; }
59
+        ///// <summary>
60
+        ///// 笔颜色 十六进制
61
+        ///// </summary>
62
+        //public string PenColor { get => _PenColor; set => _PenColor = value; }
63
+        ///// <summary>
64
+        ///// 线宽
65
+        ///// </summary>
66
+        //public int PenWigth { get => _PenWigth; set => _PenWigth = value; }
51 67
         ///// <summary>
52 68
         ///// 笔迹 暂无
53 69
         ///// </summary>

+ 2
- 0
XHWK.WKTool/App.config Vedi File

@@ -28,5 +28,7 @@
28 28
     <!--接口地址: https://schoolapitest.xhkjedu.com/
29 29
     文件上传: https://schoolfiletest.xhkjedu.com/
30 30
     展示文件:   https://schoolfiletest.xhkjedu.com/-->
31
+    <!--摄像头位置 1.右上 2.左上 3.右下 4.左下-->
32
+    <add key="CameraPosition" value=""/>
31 33
   </appSettings>
32 34
 </configuration>

+ 5
- 0
XHWK.WKTool/App.cs Vedi File

@@ -38,6 +38,9 @@ namespace XHWK.WKTool
38 38
         /// 微课视频列表
39 39
         /// </summary>
40 40
         public static List<Model_Video> VideoList = null;
41
+        /// <summary>
42
+        /// 画板模型
43
+        /// </summary>
41 44
         public static List<Model_DrawData> PageDrawList = null;
42 45
         /// <summary>
43 46
         /// 录屏工具
@@ -65,6 +68,7 @@ namespace XHWK.WKTool
65 68
         /// 页码IP
66 69
         /// </summary>
67 70
         public static string[] OutPut = new string[] { };
71
+        public static string CameraPosition = string.Empty;
68 72
         #region 点阵笔
69 73
         /// <summary>
70 74
         /// 点阵笔
@@ -112,6 +116,7 @@ namespace XHWK.WKTool
112 116
         /// 我的视频
113 117
         /// </summary>
114 118
         public static FileDirectoryWindow fileDirectoryWindow = null;
119
+        public static PrintWindow W_PrintWindow = null;
115 120
         #endregion
116 121
         #endregion
117 122
 

+ 1
- 1
XHWK.WKTool/CreateAMicroLessonWindow.xaml Vedi File

@@ -19,7 +19,7 @@
19 19
                 <RowDefinition Height="*"/>
20 20
             </Grid.RowDefinitions>
21 21
             <!--第一行 标题-->
22
-            <Border Grid.Row="0" Background="#2D8CF0">
22
+            <Border Grid.Row="0" Background="#2D8CF0" MouseLeftButtonDown="Window_MouseLeftButtonDown">
23 23
                 <Grid>
24 24
                     <TextBlock Text="创建微课" Foreground="#FFFFFF" FontSize="16" Padding="10,13,0,0"/>
25 25
                     <Button  Cursor="Hand" Grid.Row="0" x:Name="btnDown" Content="×" Foreground="#FFFFFF" FontSize="25" Padding="10,0,10,0" HorizontalAlignment="Right" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click"/>

+ 2
- 1
XHWK.WKTool/CreateAMicroLessonWindow.xaml.cs Vedi File

@@ -119,8 +119,9 @@ namespace XHWK.WKTool
119 119
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
120 120
                 //APP.W_XHMicroLessonSystemWindow .Topmost = true;
121 121
             }
122
-            APP.W_XHMicroLessonSystemWindow.ShowDialog();
123 122
             this.Hide();
123
+            APP.W_XHMicroLessonSystemWindow.ShowDialog();
124
+          
124 125
         }
125 126
         /// <summary>
126 127
         /// 窗体移动

+ 54
- 22
XHWK.WKTool/PracticeWindow.xaml.cs Vedi File

@@ -31,9 +31,17 @@ namespace XHWK.WKTool
31 31
         /// </summary>
32 32
         private int flg = 0;
33 33
         /// <summary>
34
-        /// 
34
+        /// 当前画笔颜色
35 35
         /// </summary>
36 36
         Color Colour=Colors.Black;
37
+        /// <summary>
38
+        /// 当前画笔宽
39
+        /// </summary>
40
+        private int Wit = 2;
41
+        /// <summary>
42
+        /// 当前画笔高
43
+        /// </summary>
44
+        private int Hei = 2;
37 45
         public PracticeWindow()
38 46
         {
39 47
             InitializeComponent();
@@ -50,13 +58,10 @@ namespace XHWK.WKTool
50 58
             }
51 59
 
52 60
 
53
-        
54
-
55
-
56 61
 
57 62
 
58
-            ////创建 DrawingAttributes 类的一个实例  
59
-            //drawingAttributes = new DrawingAttributes();
63
+            //创建 DrawingAttributes 类的一个实例  
64
+            drawingAttributes = new DrawingAttributes();
60 65
 
61 66
             //drawingAttributes.StylusTip = StylusTip.Rectangle;
62 67
             //drawingAttributes.IsHighlighter = false;
@@ -66,13 +71,13 @@ namespace XHWK.WKTool
66 71
 
67 72
             ////将 InkCanvas 的 DefaultDrawingAttributes 属性的值赋成创建的 DrawingAttributes 类的对象的引用  
68 73
             ////InkCanvas 通过 DefaultDrawingAttributes 属性来获取墨迹的各种设置,该属性的类型为 DrawingAttributes 型  
69
-            //blackboard_canvas.DefaultDrawingAttributes = drawingAttributes;
70
-            //Pen();
74
+            blackboard_canvas.DefaultDrawingAttributes = drawingAttributes;
75
+            Pen();
71 76
             //blackboard_canvas.Cursor = Cursors.Pen;
72 77
 
73 78
 
74
-            //Cursor cus = new Cursor(@"G:\Icon.cur");
75
-            
79
+            //Cursor cus = new Cursor(@"G:\06.cur");
80
+
76 81
             //blackboard_canvas.Cursor = cus;
77 82
 
78 83
             viewModel = new ViewModel
@@ -89,8 +94,9 @@ namespace XHWK.WKTool
89 94
         /// <param name="e"></param>
90 95
         public void White()
91 96
         {
92
-            flg = 0;
97
+            //flg = 0;
93 98
             drawingAttributes.Color = Colors.White;
99
+            Colour= Colors.White; 
94 100
         }
95 101
         /// <summary>
96 102
         /// 画笔颜色事件 红色
@@ -99,9 +105,10 @@ namespace XHWK.WKTool
99 105
         /// <param name="e"></param>
100 106
         public void Red()
101 107
         {
102
-            flg = 0;
108
+            //flg = 0;
103 109
             //设置 DrawingAttributes 的 Color 属性设置颜色  
104 110
             drawingAttributes.Color = Colors.Red;
111
+            Colour = Colors.Red;
105 112
         }
106 113
         /// <summary>
107 114
         /// 画笔颜色事件 灰色
@@ -110,8 +117,9 @@ namespace XHWK.WKTool
110 117
         /// <param name="e"></param>
111 118
         public void Gray()
112 119
         {
113
-            flg = 0;
120
+            //flg = 0;
114 121
             drawingAttributes.Color = Colors.Gray;
122
+            Colour = Colors.Gray;
115 123
         }
116 124
         /// <summary>
117 125
         /// 画笔颜色事件 青色
@@ -120,8 +128,9 @@ namespace XHWK.WKTool
120 128
         /// <param name="e"></param>
121 129
         public void CyanBlue()
122 130
         {
123
-            flg = 0;
131
+            //flg = 0;
124 132
             drawingAttributes.Color = Colors.LimeGreen;
133
+            Colour = Colors.LimeGreen;
125 134
         }
126 135
         /// <summary>
127 136
         /// 画笔颜色事件 黄色
@@ -130,8 +139,9 @@ namespace XHWK.WKTool
130 139
         /// <param name="e"></param>
131 140
         public void Yellow()
132 141
         {
133
-            flg = 0;
142
+            //flg = 0;
134 143
             drawingAttributes.Color = Colors.Gold;
144
+            Colour = Colors.Gold;
135 145
         }
136 146
         /// <summary>
137 147
         /// 画笔颜色事件 蓝色
@@ -140,8 +150,9 @@ namespace XHWK.WKTool
140 150
         /// <param name="e"></param>
141 151
         public void Blue()
142 152
         {
143
-            flg = 0;
153
+            //flg = 0;
144 154
             drawingAttributes.Color = Colors.DeepSkyBlue;
155
+            Colour = Colors.DeepSkyBlue;
145 156
         }
146 157
         /// <summary>
147 158
         /// 画笔粗细事件 细
@@ -150,9 +161,11 @@ namespace XHWK.WKTool
150 161
         /// <param name="e"></param>
151 162
         public void Fine()
152 163
         {
153
-            flg = 0;
164
+            //flg = 0;
154 165
             drawingAttributes.Width = 1;
155 166
             drawingAttributes.Height = 1;
167
+            Wit = 1;
168
+            Hei = 1;
156 169
         }
157 170
         /// <summary>
158 171
         /// 画笔粗细事件 中
@@ -161,9 +174,12 @@ namespace XHWK.WKTool
161 174
         /// <param name="e"></param>
162 175
         public void In()
163 176
         {
164
-            flg = 0;
177
+            //flg = 0;
165 178
             drawingAttributes.Width = 3;
166 179
             drawingAttributes.Height = 3;
180
+            Wit = 3;
181
+            Hei = 3;
182
+
167 183
         }
168 184
         /// <summary>
169 185
         /// 画笔粗细事件 粗
@@ -172,9 +188,11 @@ namespace XHWK.WKTool
172 188
         /// <param name="e"></param>
173 189
         public void Crude()
174 190
         {
175
-            flg = 0;
191
+            //flg = 0;
176 192
             drawingAttributes.Width = 5;
177 193
             drawingAttributes.Height = 5;
194
+            Wit = 5;
195
+            Hei = 5;
178 196
         }
179 197
         /// <summary>
180 198
         /// 橡皮
@@ -208,9 +226,9 @@ namespace XHWK.WKTool
208 226
             flg = 2;
209 227
             drawingAttributes = new DrawingAttributes
210 228
             {
211
-                Color = Colors.Red,
212
-                Width = 2,
213
-                Height = 2,
229
+                Color = Colour,
230
+                Width = Wit,
231
+                Height = Hei,
214 232
                 StylusTip = StylusTip.Rectangle,
215 233
                 //FitToCurve = true,
216 234
                 IsHighlighter = false,
@@ -219,6 +237,7 @@ namespace XHWK.WKTool
219 237
             };
220 238
             blackboard_canvas.DefaultDrawingAttributes = drawingAttributes;
221 239
             blackboard_canvas.EditingMode = InkCanvasEditingMode.None;
240
+            blackboard_canvas.Cursor = Cursors.Cross;
222 241
         }
223 242
         /// <summary>
224 243
         /// 矩形
@@ -226,7 +245,20 @@ namespace XHWK.WKTool
226 245
         public void Rectangle()
227 246
         {
228 247
             flg = 1;
248
+            drawingAttributes = new DrawingAttributes
249
+            {
250
+                Color = Colour,
251
+                Width = Wit,
252
+                Height = Hei,
253
+                StylusTip = StylusTip.Rectangle,
254
+                //FitToCurve = true,
255
+                IsHighlighter = false,
256
+                IgnorePressure = true,
257
+
258
+            };
259
+            blackboard_canvas.DefaultDrawingAttributes = drawingAttributes;
229 260
             blackboard_canvas.EditingMode = InkCanvasEditingMode.None;
261
+            blackboard_canvas.Cursor = Cursors.Cross;
230 262
         }
231 263
         private System.Windows.Point iniP;
232 264
         private void blackboard_canvas_MouseDown(object sender, MouseButtonEventArgs e)

+ 89
- 0
XHWK.WKTool/PrintWindow.xaml Vedi File

@@ -0,0 +1,89 @@
1
+<Window x:Class="XHWK.WKTool.PrintWindow"
2
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
+        xmlns:local="clr-namespace:XHWK.WKTool"
7
+        mc:Ignorable="d"
8
+        Title="PrintWindow" Height="729" Width="1028" AllowsTransparency="True"
9
+    ShowInTaskbar="False"
10
+    WindowStartupLocation="CenterOwner"
11
+    WindowStyle="None">
12
+    <Grid>
13
+        <Grid.RowDefinitions>
14
+            <RowDefinition Height="120"/>
15
+            <RowDefinition Height="*"/>
16
+            <RowDefinition Height="80"/>
17
+        </Grid.RowDefinitions>
18
+        <Grid Grid.Row="0" Background="#E6EAF0" MouseLeftButtonDown="Window_MouseLeftButtonDown">
19
+            <Grid.RowDefinitions>
20
+                <RowDefinition Height="auto"/>
21
+                <RowDefinition Height="*"/>
22
+                <RowDefinition Height="50"/>
23
+            </Grid.RowDefinitions>
24
+            <TextBlock Grid.Row="0" Text="打印预览" Background="#2E8CF0" Foreground="#FFFFFF" Width="50" HorizontalAlignment="Left" Margin="10,5,0,0"/>
25
+            <StackPanel Grid.Row="1" HorizontalAlignment="Left" Orientation="Horizontal" Margin="10,10,0,0">
26
+                <TextBlock  Text="打印机:" Width="210" FontSize="20"/>
27
+                <TextBlock Text="份数:" FontSize="20" Margin="120,0,0,0"/>
28
+                <TextBlock x:Name="txbNumberOfCopies" Width="100" Text="1" Padding="50,10,0,0" Background="White" />
29
+                <Grid>
30
+                    <Grid.RowDefinitions>
31
+                        <RowDefinition Height="auto"/>
32
+                        <RowDefinition Height="auto"/>
33
+                    </Grid.RowDefinitions>
34
+                    <Button Grid.Row="0" x:Name="btnLess" Content="-" Click="BtnLess_Click"/>
35
+                    <Button Grid.Row="1" x:Name="btnAdd" Content="+" Click="BtnAdd_Click"/>
36
+                </Grid>
37
+            </StackPanel>
38
+            <Button Grid.Row="1" x:Name="btnClose" Background="#CC4848" Foreground="#FFFFFF" Content="×" FontSize="20" Width="30" Height="30" HorizontalAlignment="Right" Margin="0,0,20,0" Click="BtnClose_Click">
39
+
40
+            </Button>
41
+            <StackPanel Grid.Row="2" HorizontalAlignment="Left" Orientation="Horizontal" Margin="10,2,0,0">
42
+                <ComboBox Cursor="Hand" Width="210"
43
+                                x:Name="cmbClass"
44
+                                Padding="10,0,10,0"
45
+                                VerticalContentAlignment="Center"
46
+                                BorderThickness="0"
47
+                                DisplayMemberPath="Value"
48
+                                FontSize="14"
49
+                                SelectedValuePath="Key"
50
+                                />
51
+                <TextBlock Text="点型:" FontSize="20"  Margin="120,10,0,0"/>
52
+                <RadioButton x:Name="rbnSquarePoint" Content="方点" FontSize="16"  Margin="0,15,0,0" IsChecked="True"/>
53
+                <RadioButton x:Name="rbnDots" Content="圆点" FontSize="16"  Margin="0,15,0,0"/>
54
+            </StackPanel>
55
+            <TextBlock Grid.Row="2" Text="关闭" HorizontalAlignment="Right" Margin="0,2,20,0"  Width="30" Height="30"/>
56
+        </Grid>
57
+        <Grid Grid.Row="1">
58
+            <Image x:Name="imgPri"/>
59
+        </Grid>
60
+
61
+        <Button
62
+                    x:Name="btnPrint"
63
+                    Grid.Row="8"
64
+                    Width="115"
65
+                    Height="46"
66
+                    Click="BtnPrint_Click"
67
+                    Content="打印"
68
+            Foreground="White"
69
+                    FontSize="17"
70
+                    IsDefault="True"
71
+                    Cursor="Hand"
72
+                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
73
+            <Button.Template>
74
+                <ControlTemplate TargetType="{x:Type Button}">
75
+                    <Border
76
+                                BorderBrush="{TemplateBinding Control.BorderBrush}"
77
+                                BorderThickness="1"
78
+                                CornerRadius="7">
79
+                        <Border.Background>#2E8CF0</Border.Background>
80
+                        <ContentPresenter
81
+                                    HorizontalAlignment="Center"
82
+                                    VerticalAlignment="Center"
83
+                                    Content="{TemplateBinding ContentControl.Content}" />
84
+                    </Border>
85
+                </ControlTemplate>
86
+            </Button.Template>
87
+        </Button>
88
+    </Grid>
89
+</Window>

+ 166
- 0
XHWK.WKTool/PrintWindow.xaml.cs Vedi File

@@ -0,0 +1,166 @@
1
+using Common.system;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.Linq;
6
+using System.Text;
7
+using System.Threading.Tasks;
8
+using System.Windows;
9
+using System.Windows.Controls;
10
+using System.Windows.Data;
11
+using System.Windows.Documents;
12
+using System.Windows.Forms;
13
+using System.Windows.Input;
14
+using System.Windows.Media;
15
+using System.Windows.Media.Imaging;
16
+using System.Windows.Shapes;
17
+
18
+namespace XHWK.WKTool
19
+{
20
+    /// <summary>
21
+    /// 打印
22
+    /// </summary>
23
+    public partial class PrintWindow : Window
24
+    {
25
+        /// <summary>
26
+        /// 下拉框数据源
27
+        /// </summary>
28
+        public DataTable data = new DataTable();
29
+        private DataTable dtComponentsUniqueNo;
30
+        public PrintWindow()
31
+        {
32
+            InitializeComponent();
33
+            string defa = string.Empty;
34
+            List<string> defaList = LatticeFileHelper.GetPrinterList(out defa);
35
+            if(defaList.Count>0)
36
+            {
37
+                data.Columns.Add("Value");
38
+                data.Columns.Add("Key");
39
+                for (int i = 0; i < defaList.Count; i++)
40
+                {
41
+                    //创建一行
42
+                    DataRow row = data.NewRow();
43
+                    //将此行添加到table中
44
+                    data.Rows.Add(row);
45
+                    data.Rows[i]["Value"] = defaList[i];
46
+                    data.Rows[i]["Key"] = i.ToString();
47
+                }
48
+                dtComponentsUniqueNo = data.DefaultView.ToTable();
49
+                cmbClass.ItemsSource = dtComponentsUniqueNo.DefaultView;
50
+                cmbClass.SelectedIndex = 0;
51
+            }
52
+        }
53
+        public void Initialize(string _imgPath)
54
+        {
55
+         if(!string.IsNullOrWhiteSpace(_imgPath))
56
+            {
57
+                imgPri.Source = new BitmapImage(new Uri(_imgPath));
58
+            }
59
+        }
60
+        /// <summary>
61
+        /// 打印
62
+        /// </summary>
63
+        /// <param name="sender"></param>
64
+        /// <param name="e"></param>
65
+        private void BtnPrint_Click(object sender, RoutedEventArgs e)
66
+        {
67
+            if(string.IsNullOrWhiteSpace(cmbClass.Text))
68
+            {
69
+                //MessageBox.Show("打印机不能为空!");
70
+                System.Windows.Forms.MessageBox.Show("打印机不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly);
71
+                return;
72
+            }
73
+            int pr = 1;
74
+            string msg = string.Empty;
75
+            string outPut = string.Empty;
76
+            int pyte = 0; //0为方点 1为圆点
77
+            if(rbnSquarePoint.IsChecked==false)
78
+            {
79
+                pyte = 1;
80
+            }
81
+            LatticeFileHelper.GeneratingPDF(@"G:\101.pdf", @"G:\102.TPF", out pr, out msg, out outPut, pyte);
82
+            if (pr == 0)
83
+            {
84
+                outPut = outPut.Replace("[", "").Replace("]", "").Replace("\"", "").Trim();
85
+                APP.OutPut = outPut.Split(',');
86
+                string []page= outPut.Split(',');
87
+                for(int i=0;i<page.Length;i++) //增加页码编号
88
+                {
89
+                    APP.PageDrawList[i].PageCode = page[i];
90
+                }
91
+              
92
+                //string defa = string.Empty;
93
+                //List<string> defaList = LatticeFileHelper.GetPrinterList(out defa);
94
+
95
+                int printResult = 1;
96
+                string standardError = string.Empty;
97
+                string standardOutput = string.Empty;
98
+                int frequency = Convert.ToInt32(txbNumberOfCopies.Text);
99
+                for (int i=0;i< frequency;i++)
100
+                {
101
+                    LatticeFileHelper.PrinterTPFFile(@"G:\102.TPF", 1, cmbClass.Text, out printResult, out standardError, out standardOutput);
102
+                }
103
+                if(printResult==0)// 0为成功
104
+                {
105
+                    //MessageBox.Show("打印成功!");
106
+                    System.Windows.Forms.MessageBox.Show("打印成功", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly);
107
+                }
108
+                else
109
+                {
110
+                    System.Windows.Forms.MessageBox.Show(standardError, "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly);
111
+                    //MessageBox.Show(standardError);
112
+                }
113
+            }
114
+            else
115
+            {
116
+                System.Windows.Forms.MessageBox.Show(msg, "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly);
117
+            }
118
+        }
119
+        /// <summary>
120
+        /// 窗口移动
121
+        /// </summary>
122
+        /// <param name="sender"></param>
123
+        /// <param name="e"></param>
124
+        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
125
+        {
126
+            DragMove();
127
+        }
128
+        /// <summary>
129
+        /// 关闭
130
+        /// </summary>
131
+        /// <param name="sender"></param>
132
+        /// <param name="e"></param>
133
+        private void BtnClose_Click(object sender, RoutedEventArgs e)
134
+        {
135
+            this.Hide();
136
+        }
137
+        /// <summary>
138
+        /// 减
139
+        /// </summary>
140
+        /// <param name="sender"></param>
141
+        /// <param name="e"></param>
142
+        private void BtnLess_Click(object sender, RoutedEventArgs e)
143
+        {
144
+            int num = Convert.ToInt32(txbNumberOfCopies.Text);
145
+            if(num>1)
146
+            {
147
+                num = num - 1;
148
+                txbNumberOfCopies.Text = num.ToString();
149
+            }
150
+        }
151
+        /// <summary>
152
+        /// 新增
153
+        /// </summary>
154
+        /// <param name="sender"></param>
155
+        /// <param name="e"></param>
156
+        private void BtnAdd_Click(object sender, RoutedEventArgs e)
157
+        {
158
+            int num = Convert.ToInt32(txbNumberOfCopies.Text);
159
+            if (num > 0)
160
+            {
161
+                num = num + 1;
162
+                txbNumberOfCopies.Text = num.ToString();
163
+            }
164
+        }
165
+    }
166
+}

+ 1
- 1
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml Vedi File

@@ -73,7 +73,7 @@
73 73
             </Grid>
74 74
 
75 75
             <Image Grid.Row="1"  Source="./Images/Toobar0.png"/>
76
-            <TextBlock Grid.Row="1" Text="01:35" FontSize="23" Foreground="#FFFFFF" Margin="30,50,0,0"/>
76
+            <TextBlock Grid.Row="1" x:Name="txbTime" Text="00:00" FontSize="23" Foreground="#FFFFFF" Margin="30,50,0,0"/>
77 77
             <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,15,0">
78 78
                 <Button x:Name="BtnRecordingScreen"  Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,15,0" Click="BtnRecordingScreen_Click">
79 79
                     <Image x:Name="ImgRecordingScreen" Source="./Images/Toobar25.png"/>

+ 157
- 36
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs Vedi File

@@ -8,6 +8,7 @@ using System.Windows;
8 8
 using System.Windows.Ink;
9 9
 using System.Windows.Media;
10 10
 using System.Windows.Media.Imaging;
11
+using System.Windows.Threading;
11 12
 using XHWK.Model;
12 13
 
13 14
 namespace XHWK.WKTool
@@ -40,6 +41,24 @@ namespace XHWK.WKTool
40 41
         Model_Video VideoInfo = null;
41 42
         //声明一个 DrawingAttributes 类型的变量  
42 43
         DrawingAttributes drawingAttributes;
44
+        private DispatcherTimer t = null;
45
+        /// <summary>
46
+        /// 计时器状态
47
+        /// </summary>
48
+        private enum State
49
+        {
50
+            Start,
51
+            Pause,
52
+            End
53
+        }
54
+        /// <summary>
55
+        /// 状态
56
+        /// </summary>
57
+        private State _state = State.End;
58
+        /// <summary>
59
+        /// 计时用
60
+        /// </summary>
61
+        private TimeSpan _timeSpan = new TimeSpan(0, 0, 0, 0, 0);
43 62
         #endregion
44 63
 
45 64
         #region 初始化
@@ -66,10 +85,79 @@ namespace XHWK.WKTool
66 85
             gridToolbar.Visibility = Visibility.Hidden;
67 86
             gridColour.Visibility = Visibility.Hidden;
68 87
             gridThickness.Visibility = Visibility.Hidden;
88
+            if (t == null)
89
+            {
90
+                t = new DispatcherTimer();
91
+                t.Tick += OnTimer;
92
+                t.Interval = new TimeSpan(0, 0, 0, 1);
93
+                t.IsEnabled = true;
94
+                t.Start();
95
+            }
96
+            t.Interval = new TimeSpan(0, 0, 0, 1);
97
+            Stack();
98
+            ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));
99
+            BtnRecordingScreen_Click(null, null);
69 100
         }
70 101
         #endregion
71 102
 
72 103
         #region 事件
104
+        /// <summary>
105
+        /// 时钟回调
106
+        /// </summary>
107
+        /// <param name="sender"></param>
108
+        /// <param name="e"></param>
109
+        private void OnTimer(object sender, EventArgs e)
110
+        {
111
+            switch (_state)
112
+            {
113
+                case State.Start:
114
+                    {
115
+                        _timeSpan += new TimeSpan(0, 0, 0, 1);
116
+                    }
117
+                    break;
118
+
119
+                case State.Pause:
120
+                    {
121
+                    }
122
+                    break;
123
+
124
+                case State.End:
125
+                    {
126
+                        _timeSpan = new TimeSpan();
127
+                        //_timeSpan = new TimeSpan(0, 23, 12, 45, 54);
128
+                    }
129
+                    break;
130
+            }
131
+
132
+            string time = string.Format("{0:D2}:{1:D2}",/* _timeSpan.Hours,*/ _timeSpan.Minutes, _timeSpan.Seconds);
133
+            //char[] times = time.ToCharArray();
134
+            txbTime.Text = time;
135
+        }
136
+        /// <summary>
137
+        /// 开始
138
+        /// </summary>
139
+        /// <param name="sender"></param>
140
+        /// <param name="e"></param>
141
+        private void Stack()
142
+        {
143
+            _state = State.Start;
144
+        }
145
+        /// <summary>
146
+        /// 暂停
147
+        /// </summary>
148
+        private void TimeOut()
149
+        {
150
+            _state = State.Pause;
151
+        }
152
+        /// <summary>
153
+        /// 结束
154
+        /// </summary>
155
+        /// <param name="sender"></param>
156
+        /// <param name="e"></param>
157
+        private void End()
158
+        {
159
+            _state = State.End;
160
+        }
73 161
         #region 录制
74 162
         /// <summary>
75 163
         /// 开始或暂停录制
@@ -80,6 +168,7 @@ namespace XHWK.WKTool
80 168
         {
81 169
             if (IsSuspend)
82 170
             {
171
+                Stack();
83 172
                 if (IsFirstRS)
84 173
                 {
85 174
                     VideoInfo = new Model_Video();
@@ -113,19 +202,19 @@ namespace XHWK.WKTool
113 202
                 }
114 203
                 IsSuspend = false;
115 204
 
116
-                #region 录像倒计时
117
-                if (APP.W_CountdownWindow == null)
118
-                {
119
-                    APP.W_CountdownWindow = new CountdownWindow();
120
-                    //APP.W_CountdownWindow.Topmost = true;
121
-                }
122
-                else
123
-                {
124
-                    APP.W_CountdownWindow.Initialize();
125
-                    //APP.W_CountdownWindow.Topmost = true;
126
-                }
127
-                APP.W_CountdownWindow.Show();
128
-                #endregion
205
+                //#region 录像倒计时
206
+                //if (APP.W_CountdownWindow == null)
207
+                //{
208
+                //    APP.W_CountdownWindow = new CountdownWindow();
209
+                //    //APP.W_CountdownWindow.Topmost = true;
210
+                //}
211
+                //else
212
+                //{
213
+                //    APP.W_CountdownWindow.Initialize();
214
+                //    //APP.W_CountdownWindow.Topmost = true;
215
+                //}
216
+                //APP.W_CountdownWindow.Show();
217
+                //#endregion
129 218
 
130 219
                 ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));
131 220
                 try
@@ -139,8 +228,9 @@ namespace XHWK.WKTool
139 228
             }
140 229
             else
141 230
             {
231
+                TimeOut();
142 232
                 IsSuspend = true;
143
-                ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));
233
+                ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
144 234
                 try
145 235
                 {
146 236
                     APP.FFmpeg.SuspendFFmpeg();
@@ -158,6 +248,17 @@ namespace XHWK.WKTool
158 248
         /// <param name="e"></param>
159 249
         private void BtnStopRecordingScreen_Click(object sender, RoutedEventArgs e)
160 250
         {
251
+            IsSuspend = true;
252
+            txbTime.Text = "00:00";
253
+            End();
254
+            ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));
255
+            if (gridToolbar.Visibility==Visibility.Visible)
256
+            {
257
+                gridToolbar.Visibility = Visibility.Hidden;
258
+                gridColour.Visibility = Visibility.Hidden;
259
+                gridThickness.Visibility = Visibility.Hidden;
260
+                APP.W_PracticeWindow.Hide();
261
+            }
161 262
             if (APP.W_XHMicroLessonSystemWindow == null)
162 263
             {
163 264
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
@@ -242,27 +343,28 @@ namespace XHWK.WKTool
242 343
             else
243 344
             {
244 345
                 gridToolbar.Visibility = Visibility.Visible;
245
-            }
246
-            //imgCanvas.Source = new BitmapImage(new Uri(imagePath));
247
-            try
248
-            {
249
-                if (APP.W_PracticeWindow == null)
346
+                try
250 347
                 {
251
-                    APP.W_PracticeWindow = new PracticeWindow();
252
-                    //APP.W_PracticeWindow.Topmost = true;
253
-                    APP.W_PracticeWindow.Width = pwidth;
254
-                    APP.W_PracticeWindow.Height = pHeight;
255
-                    APP.W_PracticeWindow.Left = 0;
256
-                    APP.W_PracticeWindow.Top = 0;
257
-                    //practiceWin.Owner = this;
348
+                    if (APP.W_PracticeWindow == null)
349
+                    {
350
+                        APP.W_PracticeWindow = new PracticeWindow();
351
+                        //APP.W_PracticeWindow.Topmost = true;
352
+                        APP.W_PracticeWindow.Width = pwidth;
353
+                        APP.W_PracticeWindow.Height = pHeight;
354
+                        APP.W_PracticeWindow.Left = 0;
355
+                        APP.W_PracticeWindow.Top = 0;
356
+                        //practiceWin.Owner = this;
357
+                    }
358
+                    APP.W_PracticeWindow.Initialize(imagePath);
359
+                    APP.W_PracticeWindow.Show();
360
+                }
361
+                catch (Exception ex)
362
+                {
363
+                    LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
258 364
                 }
259
-                APP.W_PracticeWindow.Initialize(imagePath);
260
-                APP.W_PracticeWindow.Show();
261
-            }
262
-            catch (Exception ex)
263
-            {
264
-                LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
265 365
             }
366
+            //imgCanvas.Source = new BitmapImage(new Uri(imagePath));
367
+         
266 368
         }
267 369
         /// <summary>
268 370
         /// 屏幕宽
@@ -310,6 +412,8 @@ namespace XHWK.WKTool
310 412
         {
311 413
             //drawingAttributes.Color = Colors.White;
312 414
             APP.W_PracticeWindow.White();
415
+            gridColour.Visibility = Visibility.Collapsed;
416
+            gridThickness.Visibility = Visibility.Collapsed;
313 417
         }
314 418
         /// <summary>
315 419
         /// 红色
@@ -320,6 +424,8 @@ namespace XHWK.WKTool
320 424
         {
321 425
             //drawingAttributes.Color = Colors.Red;
322 426
             APP.W_PracticeWindow.Red();
427
+            gridColour.Visibility = Visibility.Collapsed;
428
+            gridThickness.Visibility = Visibility.Collapsed;
323 429
         }
324 430
         /// <summary>
325 431
         /// 黄色
@@ -330,6 +436,8 @@ namespace XHWK.WKTool
330 436
         {
331 437
             //drawingAttributes.Color = Colors.Gold;
332 438
             APP.W_PracticeWindow.Yellow();
439
+            gridColour.Visibility = Visibility.Collapsed;
440
+            gridThickness.Visibility = Visibility.Collapsed;
333 441
         }
334 442
         /// <summary>
335 443
         /// 青色
@@ -340,6 +448,8 @@ namespace XHWK.WKTool
340 448
         {
341 449
             //drawingAttributes.Color = Colors.LimeGreen;
342 450
             APP.W_PracticeWindow.CyanBlue();
451
+            gridColour.Visibility = Visibility.Collapsed;
452
+            gridThickness.Visibility = Visibility.Collapsed;
343 453
         }
344 454
         /// <summary>
345 455
         /// 灰色
@@ -350,6 +460,8 @@ namespace XHWK.WKTool
350 460
         {
351 461
             //drawingAttributes.Color = Colors.Gray;
352 462
             APP.W_PracticeWindow.Gray();
463
+            gridColour.Visibility = Visibility.Collapsed;
464
+            gridThickness.Visibility = Visibility.Collapsed;
353 465
         }
354 466
         /// <summary>
355 467
         /// 蓝色
@@ -360,6 +472,8 @@ namespace XHWK.WKTool
360 472
         {
361 473
             //drawingAttributes.Color = Colors.DeepSkyBlue;
362 474
             APP.W_PracticeWindow.Blue();
475
+            gridColour.Visibility = Visibility.Collapsed;
476
+            gridThickness.Visibility = Visibility.Collapsed;
363 477
         }
364 478
         /// <summary>
365 479
         /// 画笔 细
@@ -369,6 +483,8 @@ namespace XHWK.WKTool
369 483
         private void BtnFine_Click(object sender, RoutedEventArgs e)
370 484
         {
371 485
             APP.W_PracticeWindow.Fine();
486
+            gridColour.Visibility = Visibility.Collapsed;
487
+            gridThickness.Visibility = Visibility.Collapsed;
372 488
         }
373 489
         /// <summary>
374 490
         /// 画笔 中
@@ -378,6 +494,8 @@ namespace XHWK.WKTool
378 494
         private void BtnIn_Click(object sender, RoutedEventArgs e)
379 495
         {
380 496
             APP.W_PracticeWindow.In();
497
+            gridColour.Visibility = Visibility.Collapsed;
498
+            gridThickness.Visibility = Visibility.Collapsed;
381 499
         }
382 500
         /// <summary>
383 501
         /// 画笔粗
@@ -387,6 +505,8 @@ namespace XHWK.WKTool
387 505
         private void BtnCrude_Click(object sender, RoutedEventArgs e)
388 506
         {
389 507
             APP.W_PracticeWindow.Crude();
508
+            gridColour.Visibility = Visibility.Collapsed;
509
+            gridThickness.Visibility = Visibility.Collapsed;
390 510
         }
391 511
         /// <summary>
392 512
         /// 橡皮
@@ -397,9 +517,6 @@ namespace XHWK.WKTool
397 517
         {
398 518
             APP.W_PracticeWindow.Eraser();
399 519
         }
400
-        #endregion
401
-
402
-        #endregion
403 520
         /// <summary>
404 521
         /// 🖊
405 522
         /// </summary>
@@ -414,7 +531,7 @@ namespace XHWK.WKTool
414 531
         /// </summary>
415 532
         /// <param name="sender"></param>
416 533
         /// <param name="e"></param>
417
-        private void BtnRound_Click(object sender, RoutedEventArgs e) 
534
+        private void BtnRound_Click(object sender, RoutedEventArgs e)
418 535
         {
419 536
             APP.W_PracticeWindow.Round();
420 537
         }
@@ -427,5 +544,9 @@ namespace XHWK.WKTool
427 544
         {
428 545
             APP.W_PracticeWindow.Rectangle();
429 546
         }
547
+        #endregion
548
+        #endregion
549
+
550
+
430 551
     }
431 552
 }

+ 22
- 17
XHWK.WKTool/XHMicroLessonSystemWindow.xaml Vedi File

@@ -36,13 +36,13 @@
36 36
                             <TextBlock x:Name="txbLoginType" Text="未登录" FontSize="14" Padding="5,0,0,0" Foreground="#FFFFFF"/>
37 37
                         </StackPanel>
38 38
                     </Button>
39
-                    <Button Cursor="Hand" x:Name="btnShrink" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnShrink_Click">
39
+                    <Button Cursor="Hand" x:Name="btnShrink" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnShrink_Click" Margin="8,0,8,0">
40 40
                         <Image Source="./Images/microLessonSystem_19.png"/>
41 41
                     </Button>
42
-                    <Button Cursor="Hand" x:Name="btnEnlarge" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="8,0,8,0">
42
+                    <!--<Button Cursor="Hand" x:Name="btnEnlarge" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="8,0,8,0">
43 43
                         <Image Source="./Images/microLessonSystem_8.png"/>
44
-                    </Button>
45
-                    <Button Cursor="Hand" x:Name="btnDown" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click">
44
+                    </Button>-->
45
+                    <Button Cursor="Hand" x:Name="btnDown" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnDown_Click" >
46 46
                         <Image Source="./Images/microLessonSystem_10.png"/>
47 47
                     </Button>
48 48
                 </StackPanel>
@@ -87,7 +87,7 @@
87 87
                 <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,10,10,0">
88 88
                     <Button Cursor="Hand" x:Name="btnAdd" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnAdd_Click">
89 89
                         <StackPanel Orientation="Vertical">
90
-                            <Image x:Name="ImgAdd" Source="./Images/microLessonSystem_25.png"/>
90
+                            <Image x:Name="ImgAdd" Source="./Images/microLessonSystem_25.png" Visibility="Visible"/>
91 91
                             <Image x:Name="ImgAddTwo" Source="./Images/microLessonSystem_24.png" Visibility="Collapsed"/>
92 92
                             <TextBlock Text="增加" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
93 93
                         </StackPanel>
@@ -101,21 +101,21 @@
101 101
                     </Button>
102 102
                     <Button Cursor="Hand" x:Name="btnUpload" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnUpload_Click">
103 103
                         <StackPanel Orientation="Vertical">
104
-                            <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_16.png"/>
105
-                            <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_15.png" Visibility="Collapsed"/>
104
+                            <Image x:Name="ImgUpload" Source="./Images/microLessonSystem_15.png" Visibility="Collapsed"/>
105
+                            <Image x:Name="ImgUploadTwo" Source="./Images/microLessonSystem_16.png" Visibility="Visible"/>
106 106
                             <TextBlock Text="上传" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
107 107
                         </StackPanel>
108 108
                     </Button>
109 109
                     <Button Cursor="Hand" x:Name="btnMyMine" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,30,0" Click="BtnMyMine_Click">
110 110
                         <StackPanel Orientation="Vertical">
111
-                            <Image x:Name="ImgMyMine" Source="./Images/microLessonSystem_1.png"/>
112
-                            <Image x:Name="ImgMyMineTwo" Source="./Images/microLessonSystem_22.png" Visibility="Collapsed"/>
111
+                            <Image x:Name="ImgMyMine" Source="./Images/microLessonSystem_22.png" Visibility="Collapsed"/>
112
+                            <Image x:Name="ImgMyMineTwo" Source="./Images/microLessonSystem_1.png" Visibility="Visible"/>
113 113
                             <TextBlock Text="我的" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
114 114
                         </StackPanel>
115 115
                     </Button>
116 116
                     <Button Cursor="Hand" x:Name="btnSetUp" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="BtnSetUp_Click">
117 117
                         <StackPanel Orientation="Vertical">
118
-                            <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png"/>
118
+                            <Image x:Name="ImgSetUp" Source="./Images/microLessonSystem_18.png" Visibility="Visible"/>
119 119
                             <Image x:Name="ImgSetUpTwo" Source="./Images/microLessonSystem_17.png" Visibility="Collapsed"/>
120 120
                             <TextBlock Text="设置" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
121 121
                         </StackPanel>
@@ -141,19 +141,24 @@
141 141
                              MouseLeftButtonUp="IMG1_MouseLeftButtonUp"
142 142
                              MouseMove="IMG1_MouseMove"
143 143
                              MouseWheel="IMG1_MouseWheel" >
144
-                                    <Image Name="imgCanvas" Width="800" Height="600" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}"  RenderOptions.BitmapScalingMode="NearestNeighbor">
144
+                                    <Image Name="imgCanvas" Width="635" Height="auto" Stretch="Uniform" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}">
145 145
                                     </Image>
146 146
                                 </ContentControl>
147 147
                             </ScrollViewer>
148 148
                         </Grid>
149 149
                     </Border>
150 150
                 </Grid>
151
-                <InkCanvas Grid.Row="0" x:Name="blackboard_canvas" Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
151
+                <Image x:Name="imgDocumentation"/>
152
+                <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
153
+                <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
152 154
                 <!--摄像头-->
153 155
                 <!--<wfi:WindowsFormsHost Grid.Row="0" Grid.Column="1" x:Name="wfhCamera" Height="124" Width="172" HorizontalAlignment="Right" Margin="0,10,30.10,0" VerticalAlignment="Top">
154 156
                     <aforge:VideoSourcePlayer x:Name="player" Height="124" Width="172"  />
155 157
                 </wfi:WindowsFormsHost>-->
156
-                <Image x:Name="imgPlayer" Width="172" Height="124"  HorizontalAlignment="Right" Margin="0,7,10,0" VerticalAlignment="Top" Visibility="Collapsed"/>
158
+                <Image x:Name="imgPlayerLeft" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
159
+                <Image x:Name="imgPlayerRight" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right"  Margin="10,7,10,10" VerticalAlignment="Top" Visibility="Collapsed"/>
160
+                <Image x:Name="imgPlayerLeftUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Left"  Margin="10,7,10,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
161
+                <Image x:Name="imgPlayerRightUnder" Width="172" Height="124" Source="./Images/microLessonSystem_17.png"  HorizontalAlignment="Right" Margin="10,7,10,10" VerticalAlignment="Bottom" Visibility="Collapsed"/>
157 162
                 <StackPanel Grid.Row="0" Orientation="Horizontal" Background="#FFFFFF" Width="180" HorizontalAlignment="Right"
158 163
             Height="58" Margin="0,830,20,0" Grid.Column="1">
159 164
                     <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
@@ -226,10 +231,10 @@
226 231
                 </StackPanel>
227 232
                 <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Left">
228 233
                     <TextBlock Text="头像位置" FontSize="16" Foreground="#2D8CF0"/>
229
-                    <RadioButton Cursor="Hand" Content="左上" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
230
-                    <RadioButton Cursor="Hand" Content="左下" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
231
-                    <RadioButton Cursor="Hand" Content="右上" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
232
-                    <RadioButton Cursor="Hand" Content="右下" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
234
+                    <RadioButton Cursor="Hand" x:Name="rbnRight" Content="右上" FontSize="14" Foreground="#333333" Margin="10,2,0,0" IsChecked="True"/>
235
+                    <RadioButton Cursor="Hand" x:Name="rbnRightUnder" Content="右下" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
236
+                    <RadioButton Cursor="Hand" x:Name="rbnLeft" Content="左上" FontSize="14" Foreground="#333333" Margin="20,2,0,0" />
237
+                    <RadioButton Cursor="Hand" x:Name="rbnLeftUnder" Content="左下" FontSize="14" Foreground="#333333" Margin="20,2,0,0"/>
233 238
                 </StackPanel>
234 239
                 <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left">
235 240
                     <TextBlock Text="视频声音" FontSize="16" Foreground="#2D8CF0"/>

+ 514
- 67
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Vedi File

@@ -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
 }

+ 7
- 0
XHWK.WKTool/XHWK.WKTool.csproj Vedi File

@@ -140,6 +140,9 @@
140 140
     <Compile Include="PracticeWindow.xaml.cs">
141 141
       <DependentUpon>PracticeWindow.xaml</DependentUpon>
142 142
     </Compile>
143
+    <Compile Include="PrintWindow.xaml.cs">
144
+      <DependentUpon>PrintWindow.xaml</DependentUpon>
145
+    </Compile>
143 146
     <Compile Include="ScreenRecordingToolbarWindow.xaml.cs">
144 147
       <DependentUpon>ScreenRecordingToolbarWindow.xaml</DependentUpon>
145 148
     </Compile>
@@ -170,6 +173,10 @@
170 173
       <SubType>Designer</SubType>
171 174
       <Generator>MSBuild:Compile</Generator>
172 175
     </Page>
176
+    <Page Include="PrintWindow.xaml">
177
+      <SubType>Designer</SubType>
178
+      <Generator>MSBuild:Compile</Generator>
179
+    </Page>
173 180
     <Page Include="Themes\Generic.xaml">
174 181
       <Generator>MSBuild:Compile</Generator>
175 182
       <SubType>Designer</SubType>

Loading…
Annulla
Salva