简体   繁体   中英

In Unity3D create a Screenshot button and it can show at the phone Gallery

Its working and its saved in my phone... but the images doesn't show at Gallery.. anyone can help me out?

File.WriteAllBytes(Application.persistentDataPath + "/" + screenShotName + Time.frameCount + ".png", screenshot.EncodeToPNG());

So how do I set the path? Main purpose is need can show at Gallery

You need the FileSystem to rescan. You can verify this will work, when you reboot your phone and it's there. Filemanagers (not gallerys) usually find the files anyway.

How to rescan is described here: How can I refresh the Gallery after I inserted an Image in android?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM