Browse Source

打印

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
a3550bedf1

+ 5
- 0
XHWK.Model/Model_DrawData.cs View File

@@ -19,6 +19,7 @@ namespace XHWK.Model
19 19
         //private List<PointF> _Handwriting;
20 20
         private string _pdfImagePath;
21 21
         private bool _imgDocumentation;
22
+        private string _type;
22 23
         /// <summary>
23 24
         /// 页码
24 25
         /// </summary>
@@ -52,6 +53,10 @@ namespace XHWK.Model
52 53
         /// </summary>
53 54
         public bool ImgDocumentation { get => _imgDocumentation; set => _imgDocumentation = value; }
54 55
         public ScaleTransform ImageSizes { get => _ImageSizes; set => _ImageSizes = value; }
56
+        /// <summary>
57
+        /// ppt word
58
+        /// </summary>
59
+        public string Type { get => _type; set => _type = value; }
55 60
         ///// <summary>
56 61
         ///// 笔颜色 十六进制
57 62
         ///// </summary>

+ 2
- 2
XHWK.WKTool/App.config View File

@@ -33,8 +33,8 @@
33 33
     <!--上传每片大小 Mb-->
34 34
     <add key="UploadSliceLen" value="1" />
35 35
     <!--版本号-->
36
-    <add key="VersionCode" value="19" />
37
-    <add key="VersionName" value="1.1.8" />
36
+    <add key="VersionCode" value="20" />
37
+    <add key="VersionName" value="1.1.9" />
38 38
     <add key="ClientSettingsProvider.ServiceUri" value="" />
39 39
   </appSettings>
40 40
   <system.web>

+ 1
- 1
XHWK.WKTool/PrintWindow.xaml View File

@@ -84,7 +84,7 @@
84 84
                     Margin="50,20,50,0"
85 85
                     Visibility="Visible" />
86 86
                     <Label Grid.Row="0"
87
-                    HorizontalAlignment="Center" Width="120"
87
+                    HorizontalAlignment="Center" Width="60"
88 88
                     x:Name="lbProcess"
89 89
                     Height="30"
90 90
                     Margin="0,20,0,0"

+ 5
- 5
XHWK.WKTool/PrintWindow.xaml.cs View File

@@ -118,7 +118,7 @@ namespace XHWK.WKTool
118 118
             Dispatcher.Invoke(() =>
119 119
             {
120 120
                 pgbProcess.Value = num;
121
-                lbProcess.Content = string.Format("{0}% / {1}%", num, 100);
121
+                lbProcess.Content = num.ToString()+"%";
122 122
                 if (num < 99)
123 123
                 {
124 124
                     num++;
@@ -166,7 +166,7 @@ namespace XHWK.WKTool
166 166
                     num = 99;
167 167
                     times.Stop();
168 168
                     pgbProcess.Value = 100;
169
-                    lbProcess.Content = string.Format("{0}% / {1}%", 100, 100);
169
+                    lbProcess.Content = "100%";
170 170
                     MessageWindow.Show("打印成功!");
171 171
                     tip_outer.Visibility = Visibility.Collapsed;
172 172
                 });
@@ -194,7 +194,7 @@ namespace XHWK.WKTool
194 194
              {
195 195
                  I = 1;
196 196
                  pgbProcess.Value = I * 100 / 100;
197
-                 lbProcess.Content = string.Format("{0}% / {1}%", I, 100);
197
+                 lbProcess.Content = I.ToString() + "%";
198 198
                  tip_outer.Visibility = Visibility.Visible;
199 199
                  //I = 0;
200 200
              });
@@ -239,7 +239,7 @@ namespace XHWK.WKTool
239 239
                             {
240 240
                                 I = 100;
241 241
                                 pgbProcess.Value = I * 100 / 100;
242
-                                lbProcess.Content = string.Format("{0}% / {1}%", I, 100);
242
+                                lbProcess.Content = I.ToString() + "%";
243 243
                                 APP.myloading.Hide();
244 244
                                 I = 0;
245 245
                             });
@@ -296,7 +296,7 @@ namespace XHWK.WKTool
296 296
                 try
297 297
                 {
298 298
                         pgbProcess.Value = I * 100 / 100;
299
-                        lbProcess.Content = string.Format("{0}% / {1}%", I, 100);
299
+                        lbProcess.Content = I.ToString() + "%";
300 300
                         I++;
301 301
                 }
302 302
                 catch (Exception ex)

+ 2
- 2
XHWK.WKTool/Properties/AssemblyInfo.cs View File

@@ -49,5 +49,5 @@ using System.Windows;
49 49
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
50 50
 //通过使用 "*",如下所示:
51 51
 // [assembly: AssemblyVersion("1.0.*")]
52
-[assembly: AssemblyVersion("1.1.8.0")]
53
-[assembly: AssemblyFileVersion("1.1.8.0")]
52
+[assembly: AssemblyVersion("1.1.9.0")]
53
+[assembly: AssemblyFileVersion("1.1.9.0")]

+ 1
- 1
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

@@ -331,7 +331,7 @@
331 331
                             </Border>
332 332
                         </Grid>
333 333
                         <Image x:Name="imgDocumentation" Visibility="Visible" VerticalAlignment="Top" Stretch="Fill"/>
334
-                        <Image x:Name="imgPPT" Visibility="Collapsed" VerticalAlignment="Top"/>
334
+                        <Image x:Name="imgPPT" Visibility="Visible" VerticalAlignment="Top"/>
335 335
                         <!--导入图片-->
336 336
                         <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
337 337
                         <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2"/>

+ 80
- 18
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

@@ -933,7 +933,7 @@ namespace XHWK.WKTool
933 933
                             X = 0.1,
934 934
                             Y = 0.1
935 935
                         };
936
-                     
936
+                        APP.PageDrawList[APP.pageData.currpage - 1].Type = "截图";
937 937
 
938 938
                         APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
939 939
                         imgCanvas.Source = bitImg;
@@ -1098,6 +1098,9 @@ namespace XHWK.WKTool
1098 1098
                             {
1099 1099
                             string[] page = images.ToArray();
1100 1100
                                 int num = 0;
1101
+
1102
+                                int iStart = APP.pageData.pagenum;//导入文档的开始下标
1103
+                                int iEnd= page.Length + APP.pageData.pagenum;//导入文档的结束下标
1101 1104
                                 for (int i = 0 + APP.pageData.pagenum; i < page.Length + APP.pageData.pagenum; i++)//给画板模型加图片路径
1102 1105
                                 {
1103 1106
                                     if (APP.PageDrawList != null && APP.PageDrawList.Count > i)
@@ -1106,16 +1109,17 @@ namespace XHWK.WKTool
1106 1109
                                         APP.PageDrawList[i].PdfImagePath = page[i - APP.pageData.pagenum];
1107 1110
                                         APP.PageDrawList[i].PageNum = i + 1;
1108 1111
                                         APP.PageDrawList[i].ImgDocumentation = true;
1112
+                                        APP.PageDrawList[i].Type = "ppt";
1109 1113
                                     }
1110 1114
                                     else
1111 1115
                                     {
1112
-
1113 1116
                                         Model_DrawData model_DrawData = new Model_DrawData
1114 1117
                                         {
1115 1118
                                             PageImagePath = page[i - APP.pageData.pagenum],
1116 1119
                                             PdfImagePath = page[i - APP.pageData.pagenum],
1117 1120
                                             PageNum = i + 1,
1118
-                                            ImgDocumentation = true
1121
+                                            ImgDocumentation = true,
1122
+                                            Type = "ppt"
1119 1123
                                         };
1120 1124
                                         APP.PageDrawList.Add(model_DrawData);
1121 1125
                                     }
@@ -1132,18 +1136,36 @@ namespace XHWK.WKTool
1132 1136
                                     APP.pageData.pagenum += num;
1133 1137
                                     gridPage.Visibility = Visibility.Visible;//页码大于0 显示
1134 1138
                                 }
1135
-                                if (APP.pageData.currpage > 0 && APP.pageData.currpage < APP.PageDrawList.Count)
1139
+                                if (APP.pageData.currpage > 0 && APP.pageData.currpage <= APP.PageDrawList.Count)
1136 1140
                                 {
1137 1141
                                     imgCanvas.Source = null;
1138 1142
                                     ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
1139 1143
                                     ImgScreenshotTwo.Visibility = Visibility.Visible;
1140 1144
                                     btnScreenshot.IsEnabled = false;
1141
-                                    imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));//给当前页面展示图片
1145
+                                    imgDocumentation.Source = null;
1146
+                                    imgPPT.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
1147
+                                    for(int i=iStart;i<iEnd;i++)
1148
+                                    {
1149
+                                        APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation = new TranslateTransform
1150
+                                        {
1151
+                                            X = 0.1,
1152
+                                            Y = 0.1
1153
+                                        };
1154
+
1155
+
1156
+                                        APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
1157
+                                        APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes = new ScaleTransform
1158
+                                        {
1159
+                                            CenterX = imgCanvas.Width,
1160
+                                            CenterY = imgCanvas.Height
1161
+                                        };
1162
+                                    }
1142 1163
                                 }
1143 1164
                                 else
1144 1165
                                 {
1145 1166
                                     imgDocumentation.Source = null;
1146 1167
                                     imgCanvas.Source = null;
1168
+                                    imgPPT.Source = null;
1147 1169
                                     ///截图可用
1148 1170
                                     ImgScreenshot.Visibility = Visibility.Visible;
1149 1171
                                     ImgScreenshotTwo.Visibility = Visibility.Collapsed;
@@ -1270,6 +1292,7 @@ namespace XHWK.WKTool
1270 1292
                                         APP.PageDrawList[i].PdfImagePath = page[i - APP.pageData.pagenum];
1271 1293
                                         APP.PageDrawList[i].PageNum = i + 1;
1272 1294
                                         APP.PageDrawList[i].ImgDocumentation = true;
1295
+                                        APP.PageDrawList[i].Type = "word";
1273 1296
                                     }
1274 1297
                                     else
1275 1298
                                     {
@@ -1279,7 +1302,8 @@ namespace XHWK.WKTool
1279 1302
                                             PageImagePath = page[i - APP.pageData.pagenum],
1280 1303
                                             PdfImagePath = page[i - APP.pageData.pagenum],
1281 1304
                                             PageNum = i + 1,
1282
-                                            ImgDocumentation = true
1305
+                                            ImgDocumentation = true,
1306
+                                            Type = "word"
1283 1307
                                         };
1284 1308
                                         APP.PageDrawList.Add(model_DrawData);
1285 1309
                                     }
@@ -1295,10 +1319,11 @@ namespace XHWK.WKTool
1295 1319
                                     APP.pageData.pagenum += num;
1296 1320
                                     gridPage.Visibility = Visibility.Visible;//页码大于0 显示
1297 1321
                                 }
1298
-                                if (APP.pageData.currpage > 0 && APP.pageData.currpage < APP.PageDrawList.Count)
1322
+                                if (APP.pageData.currpage > 0 && APP.pageData.currpage <= APP.PageDrawList.Count)
1299 1323
                                 {
1300 1324
 
1301 1325
                                     imgCanvas.Source = null;
1326
+                                    imgPPT.Source = null;
1302 1327
                                     ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
1303 1328
                                     ImgScreenshotTwo.Visibility = Visibility.Visible;
1304 1329
                                     btnScreenshot.IsEnabled = false;
@@ -1309,6 +1334,7 @@ namespace XHWK.WKTool
1309 1334
                                 {
1310 1335
                                     imgDocumentation.Source = null;
1311 1336
                                     imgCanvas.Source = null;
1337
+                                    imgPPT.Source = null;
1312 1338
                                     ///截图可用
1313 1339
                                     ImgScreenshot.Visibility = Visibility.Visible;
1314 1340
                                     ImgScreenshotTwo.Visibility = Visibility.Collapsed;
@@ -3083,6 +3109,7 @@ namespace XHWK.WKTool
3083 3109
                     APP.PageDrawList.Clear();
3084 3110
                     imgCanvas.Source = null;
3085 3111
                     imgDocumentation.Source = null;
3112
+                    imgPPT.Source = null;
3086 3113
                     gridPage.Visibility = Visibility.Collapsed;
3087 3114
                     #endregion
3088 3115
 
@@ -3359,7 +3386,7 @@ namespace XHWK.WKTool
3359 3386
                     {
3360 3387
 
3361 3388
                     }
3362
-                    else if (APP.PageDrawList[i].ImgDocumentation == true)
3389
+                    else if (APP.PageDrawList[i].ImgDocumentation == true&& !APP.PageDrawList[i].Type.Equals("ppt"))
3363 3390
                     {
3364 3391
                         image = iTextSharp.text.Image.GetInstance(APP.PageDrawList[i].PageImagePath);
3365 3392
                     }
@@ -3484,14 +3511,28 @@ namespace XHWK.WKTool
3484 3511
 
3485 3512
                         if (APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
3486 3513
                         {
3487
-                            imgCanvas.Source = null;
3488
-                            imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3489
-                            ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
3490
-                            ImgScreenshotTwo.Visibility = Visibility.Visible;
3491
-                            btnScreenshot.IsEnabled = false;
3514
+                            if("ppt".Equals(APP.PageDrawList[APP.pageData.currpage - 1].Type))
3515
+                            {
3516
+                                imgCanvas.Source = null;
3517
+                                imgDocumentation.Source = null;
3518
+                                imgPPT.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3519
+                                ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
3520
+                                ImgScreenshotTwo.Visibility = Visibility.Visible;
3521
+                                btnScreenshot.IsEnabled = false;
3522
+                            }
3523
+                            else
3524
+                            {
3525
+                                imgPPT.Source = null;
3526
+                                imgCanvas.Source = null;
3527
+                                imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3528
+                                ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
3529
+                                ImgScreenshotTwo.Visibility = Visibility.Visible;
3530
+                                btnScreenshot.IsEnabled = false;
3531
+                            }
3492 3532
                         }
3493 3533
                         else
3494 3534
                         {
3535
+                            imgPPT.Source = null;
3495 3536
                             imgDocumentation.Source = null;
3496 3537
                             imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3497 3538
                             APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
@@ -3505,6 +3546,7 @@ namespace XHWK.WKTool
3505 3546
                     }
3506 3547
                     else
3507 3548
                     {
3549
+                        imgPPT.Source = null;
3508 3550
                         imgCanvas.Source = null;
3509 3551
                         imgDocumentation.Source = null;
3510 3552
                     }
@@ -3568,14 +3610,33 @@ namespace XHWK.WKTool
3568 3610
                     {
3569 3611
                         if (APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
3570 3612
                         {
3571
-                            imgCanvas.Source = null;
3572
-                            imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3573
-                            ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
3574
-                            ImgScreenshotTwo.Visibility = Visibility.Visible;
3575
-                            btnScreenshot.IsEnabled = false;
3613
+                            if ("ppt".Equals(APP.PageDrawList[APP.pageData.currpage - 1].Type))
3614
+                            {
3615
+                                imgCanvas.Source = null;
3616
+                                imgDocumentation.Source = null;
3617
+                                imgPPT.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3618
+                                ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
3619
+                                ImgScreenshotTwo.Visibility = Visibility.Visible;
3620
+                                btnScreenshot.IsEnabled = false;
3621
+                            }
3622
+                            else
3623
+                            {
3624
+                                imgPPT.Source = null;
3625
+                                imgCanvas.Source = null;
3626
+                                imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3627
+                                ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
3628
+                                ImgScreenshotTwo.Visibility = Visibility.Visible;
3629
+                                btnScreenshot.IsEnabled = false;
3630
+                            }
3631
+                            //imgCanvas.Source = null;
3632
+                            //imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3633
+                            //ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
3634
+                            //ImgScreenshotTwo.Visibility = Visibility.Visible;
3635
+                            //btnScreenshot.IsEnabled = false;
3576 3636
                         }
3577 3637
                         else
3578 3638
                         {
3639
+                            imgPPT.Source = null;
3579 3640
                             imgDocumentation.Source = null;
3580 3641
                             imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3581 3642
                             APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
@@ -3605,6 +3666,7 @@ namespace XHWK.WKTool
3605 3666
                     }
3606 3667
                     else
3607 3668
                     {
3669
+                        imgPPT.Source = null;
3608 3670
                         imgCanvas.Source = null;
3609 3671
                         imgDocumentation.Source = null;
3610 3672
                     }

Loading…
Cancel
Save