| | |
| | | //清空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 = 8;
|
| | | framePic.AddChidren(btnPic);
|
| | | if (this.editorRoom.BackgroundImageType == 0)
|
| | | {
|
| | | btnPic.ImagePath = this.editorRoom.BackgroundImage;
|
| | | bodyFrameLayout.AddChidren(btnPic);
|
| | | }
|
| | | 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();
|
| | |
| | | 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)
|
| | |
| | | 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);
|
| | | }
|