From 944b87b6bcccb095cd73f13f4410fb20faf48f74 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期三, 25 十二月 2019 11:21:06 +0800 Subject: [PATCH] 2019.12.25 --- ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 39 ++++++++++++++++++++++++--------------- 1 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs index 685a2ac..d1e2ed5 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs @@ -59,23 +59,33 @@ //娓呯┖bodyFrame this.ClearBodyFrame(); + //鎴块棿鍥剧墖 + var framePic = new FrameLayout(); + framePic.Y = Application.GetRealHeight(60); + framePic.Width = Application.GetMinRealAverage(887); + framePic.Height = Application.GetMinRealAverage(444); + framePic.Gravity = Gravity.CenterHorizontal; + framePic.Radius = 8; + framePic.BackgroundColor = UserCenterColor.Current.BodyFrameLayout; + bodyFrameLayout.AddChidren(framePic); var btnPic = new ImageView(); - btnPic.Y = Application.GetRealHeight(60); - btnPic.Width = Application.GetMinRealAverage(887); - btnPic.Height = Application.GetMinRealAverage(444); - btnPic.Gravity = Gravity.CenterHorizontal; - btnPic.Radius = 17; - btnPic.ImagePath = this.editorRoom.BackgroundImage; - bodyFrameLayout.AddChidren(btnPic); + btnPic.Radius = 8; + framePic.AddChidren(btnPic); + if (this.editorRoom.BackgroundImageType == 0) + { + btnPic.ImagePath = this.editorRoom.BackgroundImage; + } + else + { + btnPic.ImageBytes = Common.Global.ReadFileByHomeId(this.editorRoom.BackgroundImage); + } btnPic.MouseUpEventHandler += (sender, e) => { //鎴块棿鍥剧墖閫夋嫨 this.RoomPictrueSelect(btnPic); }; //娣诲姞闃村奖鐗规晥 - var btnTemp = new ButtonBase(); - btnTemp.AddBottomShadow(btnPic, true); - btnTemp = null; + framePic.SetViewShadow(true); //鍒濆鍖栨甯� var tableContr = new InformationEditorControl(); @@ -181,13 +191,12 @@ if (editorRoom.BackgroundImageType == 1 || editorRoom.BackgroundImageType == 2) { //鍒犻櫎鎺夊師鏉ョ殑鑷畾涔夊浘鐗� - if (System.IO.File.Exists(editorRoom.BackgroundImage) == true) + if (Common.Global.IsExistsByHomeId(editorRoom.BackgroundImage) == true) { - System.IO.File.Delete(editorRoom.BackgroundImage); + Common.Global.DeleteFilebyHomeId(editorRoom.BackgroundImage); } //澶囦唤 - string[] MyArry = editorRoom.BackgroundImage.Split(new string[] { "/", @"\" }, StringSplitOptions.RemoveEmptyEntries); - HdlAutoBackupLogic.DeleteFile(MyArry[MyArry.Length - 1]); + HdlAutoBackupLogic.DeleteFile(editorRoom.BackgroundImage); } //鑷畾涔夊浘鐗� if (cloneRoom.BackgroundImageType == 1 || cloneRoom.BackgroundImageType == 2) @@ -196,7 +205,7 @@ string picName = $"RoomIcon_{DateTime.Now.ToString("yyyyMMddHHmmss")}.png"; string picFullName = System.IO.Path.Combine(Common.Config.Instance.FullPath, picName); Shared.IO.FileUtils.WriteFileByBytes(picFullName, btnPic.ImageBytes); - cloneRoom.BackgroundImage = picFullName; + cloneRoom.BackgroundImage = picName; //澶囦唤 HdlAutoBackupLogic.AddOrEditorFile(picName); } -- Gitblit v1.8.0