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!