- Home /
Saving screenshot to iPhone Camera Roll
Hey everyone...
How can I save a screenshot to the iPhone camera roll? I'm using "Application.CaptureScreenshot(Application.datapath + string)" but it fails to save to the camera roll, I always get an error saying it failed to save the file.
Do i need to use the iPhone SDK to achieve this, or is there a way to do it with unity classes? If I need to use the iPhone SDK, which is C or C++ (not sure hehe), how does that work with Unity? Example (found on web):
CGRect screenRect = [[UIScreen mainScreen] bounds];
UIGraphicsBeginImageContext(screenRect.size);
CGContextRef ctx = UIGraphicsGetCurrentContext();
[glView.layer renderInContext:ctx];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, self, nil, nil);
Thanks in advance!
Answer by zehreken · Jul 18, 2012 at 02:22 PM
There is a plug-in named 'Etcetera' from Prime31, with it you can take screenshots and do other misc. stuff like testing email, sms availability, showing native ui elements. You can write your own plug-ins for unity using obective-c but it is a pro only feature.
Answer by DeveshPandey · Oct 24, 2013 at 10:59 AM
see this : http://answers.unity3d.com/questions/387371/passing-a-value-from-unity-to-objective-c.html
or you can write me for plugin to do this.
Browse image,video and contact in Android
https://www.assetstore.unity3d.com/en/#!/content/28597
Open gallery or another android app from unity
http://u3d.as/content/devesh-pandey/app-launcher/8$$anonymous$$H
Answer by vickygroups · Apr 29, 2014 at 10:48 PM
Prime31 has no instructions, and their forums are filled with questions about how to take the photo. Unless you are a serious programmer, it's not going to work. I just spent 3 hrs trying the ideas on their forums, all of which give errors.
Here is the documentation for the etcetera plugins: https://prime31.com/docs#androidEtc | https://prime31.com/docs#iosEtc
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How to check what iDevice your using and adjust GUI sizes according... 1 Answer
how to make simple touch commands and play animation? 1 Answer
TPS Camera with Joystick (Android) 0 Answers
build for iphone - "function is not a member of object" 1 Answer