x


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!

more ▼

asked Jun 01 '11 at 09:21 PM

ronronmx gravatar image

ronronmx
806 84 101 122

interested in this as well.

Jun 01 '11 at 10:10 PM Anxowtf
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

plugin reference

more ▼

answered Jul 18 '12 at 02:22 PM

zehreken gravatar image

zehreken
0

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5093
x2001
x134
x104

asked: Jun 01 '11 at 09:21 PM

Seen: 1952 times

Last Updated: Jul 18 '12 at 02:22 PM