Bläddra i källkod

导入图片的页码

tags/录制修改前
zhangxueyang 4 år sedan
förälder
incheckning
2480f493a6
1 ändrade filer med 21 tillägg och 15 borttagningar
  1. 21
    15
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 21
- 15
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Visa fil

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

Laddar…
Avbryt
Spara