-
Notifications
You must be signed in to change notification settings - Fork 1
Save to Gallery
levching edited this page Apr 15, 2020
·
3 revisions
You may save any Texture2D to the gallery. The only limitation, that texture has to be readable.
In the example below, I am going to use SA_ScreenUtil.TakeScreenshot in order to generate app screen screenshot and save it to the gallery. However, you may use any other way to get the picture you want to add into the user phone gallery.
using SA.Foundation.Utility;
using SA.Android.Gallery;
...
SA_ScreenUtil.TakeScreenshot((screenshot) => {
AN_Gallery.SaveImageToGallery(screenshot, "Example Scnee", (result) => {
if (result.IsFailed) {
AN_Logger.Log("Filed: " + result.Error.Message);
return;
}
AN_Logger.Log("Screenshot has been saved to: " + result.Path);
});
});
Reliable and high-quality Unity Development service. Let's Talk!
Website | AssetStore | LinkedIn | Youtube | Scripting Reference
- Build Info
- Dark Mode
- Package Info
- Runtime Permissions
- Run External App
- Immersive Mode
- PackageManager
- Popups & Preloaders
- Rate Us Dialog
- Activity
- Intent
- Settings Page
- Media Player
- Date Picker Dialog
- Time Picker Dialog
- Locale
- Wheel Picker Dialog
- Developer Console Setup
- Connecting to The Service
- Purchase Flow
- Transactions Validation
- Subscriptions
- Licensing
- Getting Started
- Games Sing-in
- Server-side API Access
- Leaderboards
- Achievements
- Saved Games
- Image Manager
- Settings Intent