| | |
| | | { |
| | | btnTakePicture.IsSelected = false; |
| | | |
| | | var pid = Guid.NewGuid(); |
| | | //var pid = Guid.NewGuid(); |
| | | //CropImage.TakePicture((imagePath) => |
| | | //{ |
| | | // if (imagePath != null) |
| | | // { |
| | | // addSceneImageView.ImagePath = imagePath.ToString(); |
| | | // scene.ImagePath = addSceneImageView.ImagePath; |
| | | // MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | // } |
| | | //}, pid.ToString(), 4, 3); |
| | | |
| | | |
| | | var imageName = Guid.NewGuid().ToString() + ".png"; |
| | | CropImage.TakePicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | addSceneImageView.ImagePath = imagePath.ToString(); |
| | | scene.ImagePath = addSceneImageView.ImagePath; |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | } |
| | | }, pid.ToString(), 4, 3); |
| | | CropImageCallBack(imagePath, imageName); |
| | | }, imageName, 4, 3); |
| | | |
| | | if (pageTitleId == StringId.EditScene) |
| | | { |
| | | scene.SaveFunctionData(); |
| | |
| | | btnAlbum.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnAlbum.IsSelected = false; |
| | | var pid = Guid.NewGuid(); |
| | | //var pid = Guid.NewGuid(); |
| | | //CropImage.SelectPicture((imagePath) => |
| | | //{ |
| | | // if (imagePath != null) |
| | | // { |
| | | // addSceneImageView.ImagePath = imagePath.ToString(); |
| | | // scene.ImagePath = addSceneImageView.ImagePath; |
| | | // MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | // } |
| | | //}, pid.ToString(), 4, 3); |
| | | |
| | | //从相册选择图片裁剪 |
| | | var imageName = Guid.NewGuid().ToString() + ".png"; |
| | | CropImage.SelectPicture((imagePath) => |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | addSceneImageView.ImagePath = imagePath.ToString(); |
| | | scene.ImagePath = addSceneImageView.ImagePath; |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | } |
| | | }, pid.ToString(), 4, 3); |
| | | CropImageCallBack(imagePath, imageName); |
| | | }, imageName, 4, 3); |
| | | |
| | | |
| | | if (pageTitleId == StringId.EditScene) |
| | | { |
| | | scene.SaveFunctionData(); |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="imagePath"></param> |
| | | /// <param name="imageName"></param> |
| | | void CropImageCallBack(string imagePath, string imageName) |
| | | { |
| | | if (string.IsNullOrEmpty(imagePath) == true) |
| | | { |
| | | return; |
| | | } |
| | | //如果是自定义图片删除之前的 |
| | | if (!addSceneImageView.ImagePath.Contains("Gallery/scenebg")) |
| | | { |
| | | Utlis.WriteLine("删除: " + addSceneImageView.ImagePath); |
| | | System.IO.File.Delete(addSceneImageView.ImagePath); |
| | | } |
| | | |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | FileUtils.FileCopyToRootPath(imagePath, imageName); |
| | | System.IO.File.Delete(imagePath); |
| | | |
| | | scene.ImagePath = imageName; |
| | | addSceneImageView.ImagePath = imageName; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | btnEditSceneNameIcon.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |