|
@@ -14,6 +14,7 @@ using System.Drawing.Imaging;
|
14
|
14
|
using System.IO;
|
15
|
15
|
using System.Linq;
|
16
|
16
|
using System.Text;
|
|
17
|
+using System.Text.RegularExpressions;
|
17
|
18
|
using System.Threading;
|
18
|
19
|
using System.Windows;
|
19
|
20
|
using System.Windows.Controls;
|
|
@@ -3680,72 +3681,103 @@ namespace XHWK.WKTool
|
3680
|
3681
|
{
|
3681
|
3682
|
mouseDown = false;
|
3682
|
3683
|
HideAngleBorder();
|
|
3684
|
+
|
|
3685
|
+ //隐藏跳转
|
|
3686
|
+ txbCurrpage.Visibility = Visibility.Visible;
|
|
3687
|
+ txtJump.Visibility = Visibility.Hidden;
|
|
3688
|
+ BtnJumpPage.Visibility = Visibility.Hidden;
|
3683
|
3689
|
//if(!APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation)
|
3684
|
3690
|
//{
|
3685
|
3691
|
// ImgWG();
|
3686
|
3692
|
//}
|
3687
|
3693
|
APP.pageData.currpage -= 1;
|
3688
|
|
- myblackboard.changepage(APP.pageData.currpage - 1);
|
3689
|
|
- scroMain.ScrollToVerticalOffset(0);
|
3690
|
|
- if (btnImport.IsEnabled == true)
|
|
3694
|
+ JumpPageClick();
|
|
3695
|
+ }
|
|
3696
|
+ }
|
|
3697
|
+ /// <summary>
|
|
3698
|
+ /// 跳转
|
|
3699
|
+ /// </summary>
|
|
3700
|
+ void JumpPageClick()
|
|
3701
|
+ {
|
|
3702
|
+ myblackboard.changepage(APP.pageData.currpage - 1);
|
|
3703
|
+ scroMain.ScrollToVerticalOffset(0);
|
|
3704
|
+ if (btnImport.IsEnabled == true)
|
|
3705
|
+ {
|
|
3706
|
+ ///截图可用
|
|
3707
|
+ ImgScreenshot.Visibility = Visibility.Visible;
|
|
3708
|
+ ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
|
3709
|
+ btnScreenshot.IsEnabled = true;
|
|
3710
|
+ }
|
|
3711
|
+ if (APP.pageData.currpage <= APP.PageDrawList.Count)
|
|
3712
|
+ {
|
|
3713
|
+ if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
|
3691
|
3714
|
{
|
3692
|
|
- ///截图可用
|
3693
|
|
- ImgScreenshot.Visibility = Visibility.Visible;
|
3694
|
|
- ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
3695
|
|
- btnScreenshot.IsEnabled = true;
|
|
3715
|
+ APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
3696
|
3716
|
}
|
3697
|
|
- if (APP.pageData.currpage <= APP.PageDrawList.Count)
|
|
3717
|
+ if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && APP.pageData.currpage > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
|
3698
|
3718
|
{
|
3699
|
|
- if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
|
3700
|
|
- {
|
3701
|
|
- APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
3702
|
|
- }
|
3703
|
|
- if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && APP.pageData.currpage > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
|
|
3719
|
+ if (APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
|
3704
|
3720
|
{
|
3705
|
|
- //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
|
3706
|
|
-
|
3707
|
|
- if (APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
|
|
3721
|
+ if ("ppt".Equals(APP.PageDrawList[APP.pageData.currpage - 1].Type))
|
3708
|
3722
|
{
|
3709
|
|
- if ("ppt".Equals(APP.PageDrawList[APP.pageData.currpage - 1].Type))
|
3710
|
|
- {
|
3711
|
|
- imgCanvas.Source = null;
|
3712
|
|
- imgDocumentation.Source = null;
|
3713
|
|
- imgPPT.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
3714
|
|
- ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
|
3715
|
|
- ImgScreenshotTwo.Visibility = Visibility.Visible;
|
3716
|
|
- btnScreenshot.IsEnabled = false;
|
3717
|
|
- }
|
3718
|
|
- else
|
3719
|
|
- {
|
3720
|
|
- imgPPT.Source = null;
|
3721
|
|
- imgCanvas.Source = null;
|
3722
|
|
- imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
3723
|
|
- ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
|
3724
|
|
- ImgScreenshotTwo.Visibility = Visibility.Visible;
|
3725
|
|
- btnScreenshot.IsEnabled = false;
|
3726
|
|
- }
|
|
3723
|
+ imgCanvas.Source = null;
|
|
3724
|
+ imgDocumentation.Source = null;
|
|
3725
|
+ imgPPT.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
|
3726
|
+ ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
|
|
3727
|
+ ImgScreenshotTwo.Visibility = Visibility.Visible;
|
|
3728
|
+ btnScreenshot.IsEnabled = false;
|
3727
|
3729
|
}
|
3728
|
3730
|
else
|
3729
|
3731
|
{
|
3730
|
3732
|
imgPPT.Source = null;
|
3731
|
|
- imgDocumentation.Source = null;
|
3732
|
|
- imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
3733
|
|
- APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
|
3734
|
|
- if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
|
3735
|
|
- {
|
3736
|
|
- mouseDown = false;
|
3737
|
|
- ImgXY();
|
3738
|
|
-
|
3739
|
|
- }
|
|
3733
|
+ imgCanvas.Source = null;
|
|
3734
|
+ imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
|
3735
|
+ ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
|
|
3736
|
+ ImgScreenshotTwo.Visibility = Visibility.Visible;
|
|
3737
|
+ btnScreenshot.IsEnabled = false;
|
3740
|
3738
|
}
|
|
3739
|
+ //imgCanvas.Source = null;
|
|
3740
|
+ //imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
|
3741
|
+ //ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
|
|
3742
|
+ //ImgScreenshotTwo.Visibility = Visibility.Visible;
|
|
3743
|
+ //btnScreenshot.IsEnabled = false;
|
3741
|
3744
|
}
|
3742
|
3745
|
else
|
3743
|
3746
|
{
|
3744
|
3747
|
imgPPT.Source = null;
|
3745
|
|
- imgCanvas.Source = null;
|
3746
|
3748
|
imgDocumentation.Source = null;
|
|
3749
|
+ imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
|
3750
|
+ APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
|
|
3751
|
+ if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
|
|
3752
|
+ {
|
|
3753
|
+ //var group = IMG.FindResource("Imageview") as TransformGroup;
|
|
3754
|
+ //#region 高低 缩放比例
|
|
3755
|
+ //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
|
|
3756
|
+ //{
|
|
3757
|
+ // var transform1 = group.Children[0] as ScaleTransform;
|
|
3758
|
+ // transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
|
|
3759
|
+ // transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
|
|
3760
|
+ // imgCanvas.Width = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterX;
|
|
3761
|
+ // imgCanvas.Height = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterY;
|
|
3762
|
+ //}
|
|
3763
|
+ //#endregion
|
|
3764
|
+ //#region 坐标XY轴
|
|
3765
|
+ //var transform = group.Children[1] as TranslateTransform;
|
|
3766
|
+ //transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
|
|
3767
|
+ //transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
|
|
3768
|
+ //#endregion
|
|
3769
|
+ mouseDown = false;
|
|
3770
|
+ ImgXY();
|
|
3771
|
+
|
|
3772
|
+ }
|
3747
|
3773
|
}
|
3748
|
3774
|
}
|
|
3775
|
+ else
|
|
3776
|
+ {
|
|
3777
|
+ imgPPT.Source = null;
|
|
3778
|
+ imgCanvas.Source = null;
|
|
3779
|
+ imgDocumentation.Source = null;
|
|
3780
|
+ }
|
3749
|
3781
|
}
|
3750
|
3782
|
}
|
3751
|
3783
|
private void ImgXY()
|
|
@@ -3782,91 +3814,18 @@ namespace XHWK.WKTool
|
3782
|
3814
|
{
|
3783
|
3815
|
mouseDown = false;
|
3784
|
3816
|
HideAngleBorder();
|
|
3817
|
+
|
|
3818
|
+ //隐藏跳转
|
|
3819
|
+ txbCurrpage.Visibility = Visibility.Visible;
|
|
3820
|
+ txtJump.Visibility = Visibility.Hidden;
|
|
3821
|
+ BtnJumpPage.Visibility = Visibility.Hidden;
|
|
3822
|
+
|
3785
|
3823
|
//if (!APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation)
|
3786
|
3824
|
//{
|
3787
|
3825
|
// ImgWG();
|
3788
|
3826
|
//}
|
3789
|
3827
|
APP.pageData.currpage += 1;
|
3790
|
|
- myblackboard.changepage(APP.pageData.currpage - 1);
|
3791
|
|
- scroMain.ScrollToVerticalOffset(0);
|
3792
|
|
- if (btnImport.IsEnabled == true)
|
3793
|
|
- {
|
3794
|
|
- ///截图可用
|
3795
|
|
- ImgScreenshot.Visibility = Visibility.Visible;
|
3796
|
|
- ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
3797
|
|
- btnScreenshot.IsEnabled = true;
|
3798
|
|
- }
|
3799
|
|
- if (APP.pageData.currpage <= APP.PageDrawList.Count)
|
3800
|
|
- {
|
3801
|
|
- if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null)
|
3802
|
|
- {
|
3803
|
|
- APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = true;
|
3804
|
|
- }
|
3805
|
|
- if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
|
3806
|
|
- {
|
3807
|
|
- if (APP.PageDrawList[APP.pageData.currpage - 1].ImgDocumentation)
|
3808
|
|
- {
|
3809
|
|
- if ("ppt".Equals(APP.PageDrawList[APP.pageData.currpage - 1].Type))
|
3810
|
|
- {
|
3811
|
|
- imgCanvas.Source = null;
|
3812
|
|
- imgDocumentation.Source = null;
|
3813
|
|
- imgPPT.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
3814
|
|
- ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
|
3815
|
|
- ImgScreenshotTwo.Visibility = Visibility.Visible;
|
3816
|
|
- btnScreenshot.IsEnabled = false;
|
3817
|
|
- }
|
3818
|
|
- else
|
3819
|
|
- {
|
3820
|
|
- imgPPT.Source = null;
|
3821
|
|
- imgCanvas.Source = null;
|
3822
|
|
- imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
3823
|
|
- ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
|
3824
|
|
- ImgScreenshotTwo.Visibility = Visibility.Visible;
|
3825
|
|
- btnScreenshot.IsEnabled = false;
|
3826
|
|
- }
|
3827
|
|
- //imgCanvas.Source = null;
|
3828
|
|
- //imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
3829
|
|
- //ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
|
3830
|
|
- //ImgScreenshotTwo.Visibility = Visibility.Visible;
|
3831
|
|
- //btnScreenshot.IsEnabled = false;
|
3832
|
|
- }
|
3833
|
|
- else
|
3834
|
|
- {
|
3835
|
|
- imgPPT.Source = null;
|
3836
|
|
- imgDocumentation.Source = null;
|
3837
|
|
- imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
|
3838
|
|
- APP.PageDrawList[APP.pageData.currpage - 1].IsImageLocation = false;
|
3839
|
|
- if (APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation != null && APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X > 0)
|
3840
|
|
- {
|
3841
|
|
- //var group = IMG.FindResource("Imageview") as TransformGroup;
|
3842
|
|
- //#region 高低 缩放比例
|
3843
|
|
- //if (APP.PageDrawList[APP.pageData.currpage - 1].ImageSize != null)
|
3844
|
|
- //{
|
3845
|
|
- // var transform1 = group.Children[0] as ScaleTransform;
|
3846
|
|
- // transform1.ScaleX = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleX;
|
3847
|
|
- // transform1.ScaleY = APP.PageDrawList[APP.pageData.currpage - 1].ImageSize.ScaleY;
|
3848
|
|
- // imgCanvas.Width = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterX;
|
3849
|
|
- // imgCanvas.Height = APP.PageDrawList[APP.pageData.currpage - 1].ImageSizes.CenterY;
|
3850
|
|
- //}
|
3851
|
|
- //#endregion
|
3852
|
|
- //#region 坐标XY轴
|
3853
|
|
- //var transform = group.Children[1] as TranslateTransform;
|
3854
|
|
- //transform.X = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.X;
|
3855
|
|
- //transform.Y = APP.PageDrawList[APP.pageData.currpage - 1].ImageLocation.Y;
|
3856
|
|
- //#endregion
|
3857
|
|
- mouseDown = false;
|
3858
|
|
- ImgXY();
|
3859
|
|
-
|
3860
|
|
- }
|
3861
|
|
- }
|
3862
|
|
- }
|
3863
|
|
- else
|
3864
|
|
- {
|
3865
|
|
- imgPPT.Source = null;
|
3866
|
|
- imgCanvas.Source = null;
|
3867
|
|
- imgDocumentation.Source = null;
|
3868
|
|
- }
|
3869
|
|
- }
|
|
3828
|
+ JumpPageClick();
|
3870
|
3829
|
}
|
3871
|
3830
|
}
|
3872
|
3831
|
/// <summary>
|
|
@@ -5006,5 +4965,83 @@ namespace XHWK.WKTool
|
5006
|
4965
|
double proportion = 210.0 / 297.0;
|
5007
|
4966
|
gridM.Height = gridM.ActualWidth / proportion;
|
5008
|
4967
|
}
|
|
4968
|
+ /// <summary>
|
|
4969
|
+ /// 跳转页
|
|
4970
|
+ /// </summary>
|
|
4971
|
+ /// <param name="sender"></param>
|
|
4972
|
+ /// <param name="e"></param>
|
|
4973
|
+ private void txbCurrpage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
|
4974
|
+ {
|
|
4975
|
+ if(e.ClickCount==2)
|
|
4976
|
+ {
|
|
4977
|
+ try
|
|
4978
|
+ {
|
|
4979
|
+ if (int.Parse(txbCurrpage.Text) > 0)
|
|
4980
|
+ {
|
|
4981
|
+ txtJump.Text = txbCurrpage.Text;
|
|
4982
|
+ txbCurrpage.Visibility = Visibility.Hidden;
|
|
4983
|
+ txtJump.Visibility = Visibility.Visible;
|
|
4984
|
+ BtnJumpPage.Visibility = Visibility.Visible;
|
|
4985
|
+ txtJump.Focus();
|
|
4986
|
+ txtJump.SelectAll();
|
|
4987
|
+ }
|
|
4988
|
+ }
|
|
4989
|
+ catch (Exception)
|
|
4990
|
+ {
|
|
4991
|
+ }
|
|
4992
|
+ }
|
|
4993
|
+ }
|
|
4994
|
+ /// <summary>
|
|
4995
|
+ /// 确定跳转
|
|
4996
|
+ /// </summary>
|
|
4997
|
+ /// <param name="sender"></param>
|
|
4998
|
+ /// <param name="e"></param>
|
|
4999
|
+ private void BtnJumpPage_Click(object sender, RoutedEventArgs e)
|
|
5000
|
+ {
|
|
5001
|
+ int JumpPage = 0;
|
|
5002
|
+ try
|
|
5003
|
+ {
|
|
5004
|
+ JumpPage = int.Parse(txtJump.Text);
|
|
5005
|
+ }
|
|
5006
|
+ catch (Exception ex)
|
|
5007
|
+ {
|
|
5008
|
+ MessageWindow.Show("操作有误!请输入有效的页码!");
|
|
5009
|
+ return;
|
|
5010
|
+ }
|
|
5011
|
+ if(JumpPage<1)
|
|
5012
|
+ {
|
|
5013
|
+ JumpPage = 1;
|
|
5014
|
+ }
|
|
5015
|
+ if (JumpPage > int.Parse(txbTotalpage.Text))
|
|
5016
|
+ {
|
|
5017
|
+ JumpPage = int.Parse(txbTotalpage.Text);
|
|
5018
|
+ }
|
|
5019
|
+ #region 跳转
|
|
5020
|
+ APP.pageData.currpage = JumpPage;
|
|
5021
|
+ JumpPageClick();
|
|
5022
|
+ #endregion
|
|
5023
|
+
|
|
5024
|
+ txbCurrpage.Visibility = Visibility.Visible;
|
|
5025
|
+ txtJump.Visibility = Visibility.Hidden;
|
|
5026
|
+ BtnJumpPage.Visibility = Visibility.Hidden;
|
|
5027
|
+ }
|
|
5028
|
+ /// <summary>
|
|
5029
|
+ /// 只允许输入数字
|
|
5030
|
+ /// </summary>
|
|
5031
|
+ /// <param name="sender"></param>
|
|
5032
|
+ /// <param name="e"></param>
|
|
5033
|
+ private void txtJump_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
|
5034
|
+ {
|
|
5035
|
+ Regex re = new Regex("[^0-9.-]+");
|
|
5036
|
+ e.Handled = re.IsMatch(e.Text);
|
|
5037
|
+ }
|
|
5038
|
+
|
|
5039
|
+ private void txtJump_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
|
5040
|
+ {
|
|
5041
|
+ if (e.Key == Key.Enter)
|
|
5042
|
+ {
|
|
5043
|
+ BtnJumpPage_Click(null, null);
|
|
5044
|
+ }
|
|
5045
|
+ }
|
5009
|
5046
|
}
|
5010
|
5047
|
}
|