Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by ShanMirza28 · Sep 23, 2015 at 11:07 AM · webplayerwindows phone 8

How to save screenshot in windows phone gallery using unity ?

I am trying to save the texture using the untiy Method of Application.CaptureScreenShot(); but it not save the screen shot to the windows phone camera roll or gallery.i have searched a lot of foroums for my problem but found nothing. :( Can anyone please solve this issue or suggest me any link. Thanks in advanced. :)

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hellium · Sep 23, 2015 at 08:47 AM 0
Share

Have you checked the persistent data path ?

On mobile platforms the filename is appended to the persistent data path.

http://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html

avatar image ShanMirza28 Hellium · Sep 23, 2015 at 09:51 AM 0
Share

yes i can see the screenshots that are save in my local computer.but that are not save to the gallery or camera roll of windows phone.

avatar image Hellium ShanMirza28 · Sep 23, 2015 at 10:11 AM 0
Share

I guess the gallery does not look for images in the persistent data path simply. Try to find how you can move the screenshot inside the standard images folder.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by jijieciprian · Oct 06, 2016 at 02:18 PM

@ShanMirza28

To save a screenshot in windows phone using unity need to do like this:

  1. Use this directive #if NETFX_CORE to declare some code for windows phone :

    StorageFolder picturesLibraryFolder = KnownFolders.PicturesLibrary //(picture library folder)

  2. Write a method with two param (fileName and byte[] file (here is image encoded to png/jpg from texture2D when make capture)

    --async YourNameMethod(string fileName, byte[] file)--

  3. In body need to use a storage file where wou need to create a file in your picture library folder.

    StorageFile storageFile = await picturesLibraryFolder.CreateFileAsync(fileName);

  4. And finaly you need to write bytes

    await FileIO.WriteBytesAsync(storageFile, file);

To be more easier:

 #if NETFX_CORE
 async void SaveYourScreenShotInPicturesLibrary(string fileName, byte[] file)
     {
         StorageFile storageFile = await picturesLibraryFolder.CreateFileAsync(fileName);
         await FileIO.WriteBytesAsync(storageFile, file);
     }
 #endif
 
 void MethodWhereYouCallSave(string fileName, byte[] file)
 {
 #if NETFX_CORE
      SaveYourScreenShotInPicturesLibrary(fileName,file)
 #endif
 }
 

try like this and let me know :)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ArchVen · Feb 22, 2017 at 10:46 AM 0
Share

It won't work since it requires Windows.Storage library and C#6.0 support. While Unity is not officially support C#6.0 right now. And even with third-party plugin that allow support of C#6-7 - it still didn't work. $$anonymous$$ay be you know some other workaround for saving in Picture gallery on UWP ?

avatar image PuzzleBuilder · Jun 02, 2018 at 02:36 PM 0
Share

I tried something similar, and it didn't seem to work for me either.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

Webplayer Stream problem 1 Answer

Why won't my specular shaders work in the WebPlayer? 0 Answers

RMB no longer works in UNITY web player 2 Answers

Can't replace loading image in web player 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges