Browse Source

导入图片的页码

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
2480f493a6
1 changed files with 21 additions and 15 deletions
  1. 21
    15
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 21
- 15
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

31
         public readonly BlackboardNew myblackboard;
31
         public readonly BlackboardNew myblackboard;
32
         private System.Windows.Forms.DialogResult result;
32
         private System.Windows.Forms.DialogResult result;
33
         private System.Windows.Forms.OpenFileDialog ofd;
33
         private System.Windows.Forms.OpenFileDialog ofd;
34
+        //声明一个 DrawingAttributes 类型的变量  
35
+        DrawingAttributes drawingAttributes;
34
         #endregion
36
         #endregion
35
 
37
 
36
         #region 初始化
38
         #region 初始化
231
             //设置 DrawingAttributes 的 Color 属性设置颜色  
233
             //设置 DrawingAttributes 的 Color 属性设置颜色  
232
             drawingAttributes.Color = Colors.White;
234
             drawingAttributes.Color = Colors.White;
233
         }
235
         }
234
-        //声明一个 DrawingAttributes 类型的变量  
235
-        DrawingAttributes drawingAttributes;
236
         /// <summary>
236
         /// <summary>
237
         /// 画笔颜色事件 红色
237
         /// 画笔颜色事件 红色
238
         /// </summary>
238
         /// </summary>
281
             drawingAttributes.Color = Colors.DeepSkyBlue;
281
             drawingAttributes.Color = Colors.DeepSkyBlue;
282
         }
282
         }
283
         /// <summary>
283
         /// <summary>
284
-        /// 画笔粗细 细
284
+        /// 画笔粗细事件
285
         /// </summary>
285
         /// </summary>
286
         /// <param name="sender"></param>
286
         /// <param name="sender"></param>
287
         /// <param name="e"></param>
287
         /// <param name="e"></param>
291
             drawingAttributes.Height = 1;
291
             drawingAttributes.Height = 1;
292
         }
292
         }
293
         /// <summary>
293
         /// <summary>
294
-        /// 画笔粗细 中
294
+        /// 画笔粗细事件
295
         /// </summary>
295
         /// </summary>
296
         /// <param name="sender"></param>
296
         /// <param name="sender"></param>
297
         /// <param name="e"></param>
297
         /// <param name="e"></param>
301
             drawingAttributes.Height = 3;
301
             drawingAttributes.Height = 3;
302
         }
302
         }
303
         /// <summary>
303
         /// <summary>
304
-        /// 画笔粗细 粗
304
+        /// 画笔粗细事件
305
         /// </summary>
305
         /// </summary>
306
         /// <param name="sender"></param>
306
         /// <param name="sender"></param>
307
         /// <param name="e"></param>
307
         /// <param name="e"></param>
311
             drawingAttributes.Height = 5;
311
             drawingAttributes.Height = 5;
312
         }
312
         }
313
         /// <summary>
313
         /// <summary>
314
-        /// 登陆
314
+        /// 登陆事件
315
         /// </summary>
315
         /// </summary>
316
         /// <param name="sender"></param>
316
         /// <param name="sender"></param>
317
         /// <param name="e"></param>
317
         /// <param name="e"></param>
357
             }
357
             }
358
         }
358
         }
359
         /// <summary>
359
         /// <summary>
360
-        /// 导入
360
+        /// 导入事件
361
         /// </summary>
361
         /// </summary>
362
         /// <param name="sender"></param>
362
         /// <param name="sender"></param>
363
         /// <param name="e"></param>
363
         /// <param name="e"></param>
409
                     string filepath = ofd.FileName;
409
                     string filepath = ofd.FileName;
410
                     string path = AppDomain.CurrentDomain.BaseDirectory+ "Temp\\";
410
                     string path = AppDomain.CurrentDomain.BaseDirectory+ "Temp\\";
411
                     APP.Paths = ConvertWordToImage(filepath, path, "", 0, 0, null, 0).ToArray();
411
                     APP.Paths = ConvertWordToImage(filepath, path, "", 0, 0, null, 0).ToArray();
412
-                    if(!string.IsNullOrWhiteSpace(txbCurrpage.Text)&& Convert.ToInt32(txbCurrpage.Text)< APP.Paths.Length)
412
+                   
413
+                    for(int i=0;i<APP.Paths.Length;i++)
414
+                    {
415
+                        APP.pageData.pagenum += 1;
416
+                        APP.pageData.currpage = APP.pageData.pagenum;
417
+                        myblackboard.changepage(APP.pageData.currpage - 1);
418
+                    }
419
+                    if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage < APP.Paths.Length)
413
                     {
420
                     {
414
                         imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[Convert.ToInt32(txbCurrpage.Text) - 1]));
421
                         imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[Convert.ToInt32(txbCurrpage.Text) - 1]));
415
                     }
422
                     }
417
                     {
424
                     {
418
                         imgCanvas.Source = null;
425
                         imgCanvas.Source = null;
419
                     }
426
                     }
420
-                    
421
                 }
427
                 }
422
             }
428
             }
423
         }
429
         }
448
             }
454
             }
449
         }
455
         }
450
         /// <summary>
456
         /// <summary>
451
-        /// 增加
457
+        /// 增加事件
452
         /// </summary>
458
         /// </summary>
453
         /// <param name="sender"></param>
459
         /// <param name="sender"></param>
454
         /// <param name="e"></param>
460
         /// <param name="e"></param>
461
             }
467
             }
462
         }
468
         }
463
         /// <summary>
469
         /// <summary>
464
-        /// 打印
470
+        /// 打印事件
465
         /// </summary>
471
         /// </summary>
466
         /// <param name="sender"></param>
472
         /// <param name="sender"></param>
467
         /// <param name="e"></param>
473
         /// <param name="e"></param>
495
                 myblackboard.changepage(APP.pageData.currpage - 1);
501
                 myblackboard.changepage(APP.pageData.currpage - 1);
496
                 if(APP.Paths.Length>0)
502
                 if(APP.Paths.Length>0)
497
                 {
503
                 {
498
-                    if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && Convert.ToInt32(txbCurrpage.Text) < APP.Paths.Length&& Convert.ToInt32(txbCurrpage.Text)>1)
504
+                    if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage < APP.Paths.Length&& APP.pageData.currpage > 0)
499
                     {
505
                     {
500
-                        imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[Convert.ToInt32(txbCurrpage.Text) - 2]));
506
+                        imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));
501
                     }
507
                     }
502
                     else
508
                     else
503
                     {
509
                     {
520
                 myblackboard.changepage(APP.pageData.currpage - 1);
526
                 myblackboard.changepage(APP.pageData.currpage - 1);
521
                 if (APP.Paths.Length > 0)
527
                 if (APP.Paths.Length > 0)
522
                 {
528
                 {
523
-                    if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && Convert.ToInt32(txbCurrpage.Text)+1 < APP.Paths.Length)
529
+                    if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage < APP.Paths.Length)
524
                     {
530
                     {
525
-                        imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[Convert.ToInt32(txbCurrpage.Text) ]));
531
+                        imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage]));
526
                     }
532
                     }
527
                     else
533
                     else
528
                     {
534
                     {

Loading…
Cancel
Save