Selaa lähdekoodia

打印 优化, 没有页时 提示不可以打印。

tags/录制修改前
zhangxueyang 4 vuotta sitten
vanhempi
commit
ae2bc1abe5

+ 4
- 0
XHWK.WKTool/PrintWindow.xaml.cs Näytä tiedosto

@@ -76,6 +76,10 @@ namespace XHWK.WKTool
76 76
             {
77 77
                 imgPri.Source = new BitmapImage(new Uri(_imgPath));
78 78
             }
79
+            else
80
+            {
81
+                imgPri.Source = null;
82
+            }
79 83
             I = 0;
80 84
             if (t == null)
81 85
             {

+ 2
- 2
XHWK.WKTool/XHMicroLessonSystemWindow.xaml Näytä tiedosto

@@ -625,9 +625,9 @@
625 625
                     <RowDefinition Height="50"/>
626 626
                 </Grid.RowDefinitions>
627 627
                 <Label x:Name="lblVideoMess" Grid.Row="0" Content="暂无微课录制信息,请录制并等待保存完成后重试!" HorizontalAlignment="Center" Margin="0,0,0,100" VerticalAlignment="Center" FontSize="20" Visibility="Hidden"/>
628
-                <Button x:Name="BtnVideoUpPage" Content="上一页" HorizontalAlignment="Center" Margin="0,0,150,10" Grid.Row="1" VerticalAlignment="Bottom" Width="60" Background="{x:Null}" BorderBrush="{x:Null}" FontSize="16" Foreground="#FF333333" Click="BtnVideoUpPage_Click"/>
628
+                <Button  Cursor="Hand" x:Name="BtnVideoUpPage" Content="上一页" HorizontalAlignment="Center" Margin="0,0,150,10" Grid.Row="1" VerticalAlignment="Bottom" Width="60" Background="{x:Null}" BorderBrush="{x:Null}" FontSize="16" Foreground="#FF333333"  Click="BtnVideoUpPage_Click"/>
629 629
                 <Label x:Name="lblVideoPageNum" Grid.Row="1" FontSize="14" Content="100/100" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,10" Foreground="#FF333333" />
630
-                <Button x:Name="BtnVideoDownPage" Content="下一页" HorizontalAlignment="Center" Margin="150,0,0,10" Grid.Row="1" VerticalAlignment="Bottom" Width="60" Background="{x:Null}" BorderBrush="{x:Null}" FontSize="16" Foreground="#FF333333" Click="BtnVideoDownPage_Click"/>
630
+                <Button  Cursor="Hand" x:Name="BtnVideoDownPage" Content="下一页" HorizontalAlignment="Center" Margin="150,0,0,10" Grid.Row="1" VerticalAlignment="Bottom" Width="60" Background="{x:Null}" BorderBrush="{x:Null}" FontSize="16" Foreground="#FF333333" Click="BtnVideoDownPage_Click"/>
631 631
             </Grid>
632 632
 
633 633
             <Grid Grid.Row="2" Background="#EFF1F8" Margin="0,0,0,0">

+ 11
- 3
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Näytä tiedosto

@@ -472,7 +472,7 @@ namespace XHWK.WKTool
472 472
                     gridSetUp.Visibility = Visibility.Visible;
473 473
                     gridUpload.Visibility = Visibility.Collapsed;
474 474
                     txbStoragePath.Content = APP.WKData.WkPath;
475
-
475
+                    GridMyVideo.Visibility = Visibility.Collapsed;
476 476
                     #region 读取用户配置
477 477
                     //接口地址
478 478
                     if (!File.Exists(APP.dataPath + "interfaceAddress.txt")) //若为空
@@ -985,7 +985,7 @@ namespace XHWK.WKTool
985 985
                 ofd = new System.Windows.Forms.OpenFileDialog
986 986
                 {
987 987
                     //Filter = "文档|*.docx;*.doc;*.ppt;*.pptx",
988
-                    Filter = "文档|*.docx;*.doc;*.ppt;*.pptx;*.pdf",
988
+                    Filter = "文档|*.docx;*.doc;*.ppt;*.pptx",
989 989
                     InitialDirectory = desktopPath,
990 990
                     Multiselect = false,
991 991
                     AddExtension = true,
@@ -3280,6 +3280,9 @@ namespace XHWK.WKTool
3280 3280
                 PageNum = APP.pageData.currpage
3281 3281
             };
3282 3282
             APP.PageDrawList.Add(model_DrawData);
3283
+             ImgPrint.Visibility = Visibility.Visible;//可打印
3284
+                                ImgPrintTwo.Visibility = Visibility.Collapsed;
3285
+                                btnPrint.IsEnabled = true;
3283 3286
             //APP.SaveDraw();
3284 3287
             if (btnImport.IsEnabled == true)
3285 3288
             {
@@ -3299,7 +3302,11 @@ namespace XHWK.WKTool
3299 3302
             try
3300 3303
             {
3301 3304
                 //3种情况  1.文档图片 2.截图图片 3.没有图片
3302
-
3305
+                if(APP.PageDrawList.Count==0)
3306
+                {
3307
+                    MessageWindow.Show("没有可打印的页,您可以新增、截图或导入来增加页!");
3308
+                    return;
3309
+                }
3303 3310
 
3304 3311
 
3305 3312
                 iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
@@ -4672,6 +4679,7 @@ namespace XHWK.WKTool
4672 4679
             GridMain.Visibility = Visibility.Visible;
4673 4680
             gridSetUp.Visibility = Visibility.Collapsed;
4674 4681
             gridUpload.Visibility = Visibility.Collapsed;
4682
+            GridMyVideo.Visibility = Visibility.Collapsed;
4675 4683
             if (APP.pageData.pagenum > 0)
4676 4684
             {
4677 4685
                 gridPage.Visibility = Visibility.Visible;

Loading…
Peruuta
Tallenna