// For Save IEnumerator CaptureScreen() { yield return(new WaitForEndOfFrame()); // Save to PhotoLibrary Texture2D screenShot = ScreenCapture.Capture(); if (saveAsPng) { bool withTransparency = false; if (withTransparency) { // PNG with transparency LoadTextureFromImagePicker.SaveAsPngWithTransparencyToPhotoLibrary(screenShot, gameObject.name, "OnFinishedSaveImage"); } else { // PNG LoadTextureFromImagePicker.SaveAsPngToPhotoLibrary(screenShot, gameObject.name, "OnFinishedSaveImage"); } } else { // JPG LoadTextureFromImagePicker.SaveAsJpgToPhotoLibrary(screenShot, gameObject.name, "OnFinishedSaveImage"); } }
// For Save IEnumerator CaptureScreen() { yield return(new WaitForEndOfFrame()); //Get another copy to show on share screen Texture2D screenshot = ScreenCapture.Capture(); Color32[] pix = screenshot.GetPixels32(); Destroy(screenShotCopy); screenShotCopy = new Texture2D(screenshot.width, screenshot.height); screenShotCopy.SetPixels32(pix); screenShotCopy.Apply(); Debug.Log("Capture one frame"); #if UNITY_IPHONE if (Application.platform == RuntimePlatform.IPhonePlayer) { LoadTextureFromImagePicker.SaveAsJpgToPhotoLibrary(screenshot, gameObject.name, "OnFinishedSaveImage"); } #endif if (Application.platform == RuntimePlatform.Android) { SaveImageToLibraryAndriod(screenshot); } //FOR TEST //OnFinishedSaveImage(""); }
// For Save IEnumerator CaptureScreen() { yield return(new WaitForEndOfFrame()); uploadImage = ScreenCapture.Capture(); LoadTextureFromImagePicker.SaveAsJpgToPhotoLibrary(uploadImage, gameObject.name, "OnFinishedSaveImage"); }