Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by fer23gunner · Jul 24, 2012 at 05:51 PM · androidpathscreenshotpicturephoto

I need to set the path for saving the pictures with an application for Android and IOS

My actual code:

function Update() { if(Input.GetMouseButtonDown(0)) { Debug.Log("foto");

  Application.CaptureScreenshot(Application.dataPath + "Screenshot.png");

} }

I need the path for the output of every photo for this function.

Thanks!

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by whydoidoit · Jul 24, 2012 at 06:00 PM

You probably don't want to use the same file each time, you also need to prepend a "/" to the file name and you should use Application.persistentDataPath rather than dataPath.

It might be worth creating a unique name like this:

    var name = System.Guid.NewGuid().ToString();

The path is different on different devices I believe. If you want to know what it is on a particular device then Debug.Log(Application.persistentDataPath).

Comment
Add comment · Show 8 · 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 fer23gunner · Jul 30, 2012 at 01:39 PM 0
Share

The problem is that i want to change the default path.

Thanks for the answer but the problem is not solved yet.

avatar image whydoidoit · Jul 30, 2012 at 01:44 PM 0
Share

You can't write anywhere else on the device apart from there (or a folder beneath it). Normally you would write it there and then have the device API move it. For example Prime31 lets you add it to the current camera roll on iOS.

avatar image fer23gunner · Jul 30, 2012 at 01:58 PM 0
Share

and have android some like "Prime31" for moving the current screenshot to the gallery?

thanks

avatar image whydoidoit · Jul 30, 2012 at 02:01 PM 0
Share

Yes you can find the documentation here - looks like saveImageToGallery

avatar image fer23gunner · Jul 30, 2012 at 03:21 PM 0
Share

Thanks man this is nice, but i have to pay for downloading the plugins. Another way to take a function like that?

Show more comments
avatar image
0

Answer by fer23gunner · Jul 30, 2012 at 05:13 PM

any idea?

Comment
Add comment · 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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Save Image to Android Photo gallery 1 Answer

Access file in Android with Streamreader 0 Answers

Saving Screenshots to Android Gallery 8 Answers

Share Screenshot Image to Facebook with Facebook SDK 0 Answers

How to solve the error "Failed to store screen shot" in Android 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