Browse Source

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

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

+ 4
- 0
XHWK.WKTool/PrintWindow.xaml.cs View File

76
             {
76
             {
77
                 imgPri.Source = new BitmapImage(new Uri(_imgPath));
77
                 imgPri.Source = new BitmapImage(new Uri(_imgPath));
78
             }
78
             }
79
+            else
80
+            {
81
+                imgPri.Source = null;
82
+            }
79
             I = 0;
83
             I = 0;
80
             if (t == null)
84
             if (t == null)
81
             {
85
             {

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

625
                     <RowDefinition Height="50"/>
625
                     <RowDefinition Height="50"/>
626
                 </Grid.RowDefinitions>
626
                 </Grid.RowDefinitions>
627
                 <Label x:Name="lblVideoMess" Grid.Row="0" Content="暂无微课录制信息,请录制并等待保存完成后重试!" HorizontalAlignment="Center" Margin="0,0,0,100" VerticalAlignment="Center" FontSize="20" Visibility="Hidden"/>
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
                 <Label x:Name="lblVideoPageNum" Grid.Row="1" FontSize="14" Content="100/100" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,10" Foreground="#FF333333" />
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
             </Grid>
631
             </Grid>
632
 
632
 
633
             <Grid Grid.Row="2" Background="#EFF1F8" Margin="0,0,0,0">
633
             <Grid Grid.Row="2" Background="#EFF1F8" Margin="0,0,0,0">

+ 11
- 3
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

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

Loading…
Cancel
Save