When i use console command “shot”, it will have a image on project, i can see it or load it again to texture2d, it doesn’t appear in my Iphone Gallery,
i just try some Objective C code to save it to camera roll like this:
FString AScreenshooter::RequestNewScreenshot()
{
FString filename = "Image.png";
FScreenshotRequest::RequestScreenshot(filename, false, false);
return FScreenshotRequest::GetFilename();
}
void AScreenshooter::SaveNativeScreenshot()
{
/*#if PLATFORM_IOS
[Screenshooter saveScreenshotNative];
#endif*/
#if PLATFORM_IOS
//NSString* file = @"/private/var/mobile/Media/DCIM/Image.png";
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"/ScreenShotPrj/Saved/Screenshots/IOS/Image.png"];
//NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:file];
UIImage *image = [UIImage imageWithContentsOfFile:filePath];
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
#endif
}
but when i package it will be crashed when i open app
Anyone helps me please???