private void onGetImageCropComplete(string imagePath) { dispatcher.InvokeAction( () => { this.imagePath = imagePath; UpdateStatus("Get Image Crop Complete"); Invoke("LoadImageMessage", 0.3f); Invoke("DelayLoadImage", 0.5f); string base64 = utilsPlugin.GetImageBase64(imagePath); string folderPath = utilsPlugin.CreateRootFolder("AUPCropImageFolder"); // generate timestamp based on current time on the device string imageID = TimeHelper.GetMilliSecondSinceEpoch().ToString(); if (!folderPath.Equals("", StringComparison.Ordinal)) { utilsPlugin.SaveImageBase64(base64, folderPath + "/" + imageID + ".jpg"); } Debug.Log(TAG + "onGetImageCropComplete imagePath " + imagePath); string testPath = utilsPlugin.getExternalStorageDirectory() + "/" + "AUPCropImageFolder" + "/" + imageID + ".jpg"; base64 = utilsPlugin.GetImageBase64(testPath); // bonus you can also create hidden folder and save image inside it string newfolderPath = utilsPlugin.CreateRootFolder(".SecretContainerImage"); if (!newfolderPath.Equals("", StringComparison.Ordinal)) { utilsPlugin.SaveImageBase64(base64, newfolderPath + "/testImage22.jpg"); } } ); }
private void onGetImageCropComplete(string imagePath) { dispatcher.InvokeAction( () => { string base64 = utilsPlugin.GetImageBase64(imagePath); Texture2D tex = new Texture2D(180, 180, TextureFormat.ARGB32, false); tex.LoadImage(Convert.FromBase64String(base64)); } ); }