using Common.system; using System; using System.Collections.Generic; using System.Threading; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Imaging; using XHZB.Desktop.Utils; using XHZB.Model; namespace XHZB.Desktop { /// /// 批注 /// public partial class PracticeWindow : Window { private readonly ZBPageModel pageData = new ZBPageModel(); private readonly BlackboardNew myblackboard; internal double pwidth = SystemParameters.PrimaryScreenWidth; internal double pHeight = SystemParameters.PrimaryScreenHeight; private readonly List ImageInfo = new List(); private readonly int serverReturnCode = 0; //private readonly RegisterController registerController = new RegisterController(); /// /// 保存图片路径 /// private string Rfpath = string.Empty; /// /// 初始创建黑板 /// private readonly bool isfirstload = true; private System.Windows.Media.Color Color = System.Windows.Media.Colors.Red; private int Size = 3; private string AskidName = string.Empty; /// /// 批注 /// public PracticeWindow() { InitializeComponent(); if (isfirstload) { myblackboard = new BlackboardNew(blackboard_canvas, Colors.Red); initData(); isfirstload = false; } } /// /// 初始化页面 /// public void Initialize() { this.Opacity = 1; m_grid.Background = new SolidColorBrush(Colors.Black); AskidName = string.Empty; isFDetais = true; pageData.pagenum = ImageInfo.Count; Rfpath = string.Empty; Uri uri = new Uri(ImageInfo[pageData.currpage - 1], UriKind.Absolute); BitmapImage bitmapImage = new BitmapImage(uri); myblackboard.changepage(pageData.currpage - 1); m_image.Source = bitmapImage; } private void initData() { pageData.menuList.Add(new ZBMenuModel() { Name = "铅笔", Pic = "../Images/Blackboard/class_2s.png", Selected = true }); pageData.menuList.Add(new ZBMenuModel() { Name = "颜色", Pic = "../Images/Blackboard/class_c1.png", Selected = false }); pageData.menuList.Add(new ZBMenuModel() { Name = "粗细", Pic = "../Images/Blackboard/class_s1.png", Selected = false }); pageData.menuList.Add(new ZBMenuModel() { Name = "橡皮", Pic = "../Images/Blackboard/class_3un.png", Selected = false }); pageData.menuList.Add(new ZBMenuModel() { Name = "清空", Pic = "../Images/Blackboard/class_6un.png", Selected = false }); pageData.menuList.Add(new ZBMenuModel() { Name = "撤销", Pic = "../Images/Blackboard/class_4un.png", Selected = false }); pageData.menuList.Add(new ZBMenuModel() { Name = "恢复", Pic = "../Images/Blackboard/class_5un.png", Selected = false }); pageData.menuList.Add(new ZBMenuModel() { Name = "退出", Pic = "../Images/Blackboard/class_7un.png", Selected = false }); DataContext = pageData; } /// /// 暂修改为传图片地址 新增一页 /// /// public void addImage(string _imageInfo) { ImageInfo.Add(_imageInfo); pageData.currpage = ImageInfo.Count; Initialize(); } private void menu_item_Click(object sender, RoutedEventArgs e) { int clickindex = 0; List