简体   繁体   English

可以在任何视图中截取屏幕截图的屏幕截图应用

[英]Screenshot app that can take screenshots in any view

I know it is possible to take screenshots inside your own app but I was wondering if it is possible to have an app that allows you to capture screenshots in any view as long as the app it open. 我知道可以在自己的应用程序中截取屏幕截图,但是我想知道是否有可能允许一个只要打开应用程序就可以在任何视图中捕获屏幕截图的应用程序。 Im pretty sure its not possible but I just wanted to double check. 我很确定这是不可能的,但我只想仔细检查。 Thank you. 谢谢。

不,在iOS上无法与沙箱之外的其他应用程序进行交互。

Its an iOS default. 它是iOS的默认设置。 If you press the Home + Power button at the same time the iOS device will take a screenshot and store the screenshot in your photos app. 如果您同时按下Home + Power按钮,则iOS设备将截取屏幕截图并将其存储在您的照片应用中。

In other words, you would like to spy on other apps. 换句话说,您想监视其他应用程序。 Like the user's banking information. 喜欢用户的银行信息。 Now that the question is rephrased, I'll bet you know the answer (and why it won't change even if you file a feature request). 现在,问题已被改写,我打赌您知道答案了(为什么即使您提出功能请求也不会改变)。

- (IBAction)saveScreenshot {        
    // Define the dimensions of the screenshot you want to take (the entire screen in this case)
    CGSize size =  [[UIScreen mainScreen] bounds].size;

    // Create the screenshot
    UIGraphicsBeginImageContext(size);
    // Put everything in the current view into the screenshot
    [[self.view layer] renderInContext:UIGraphicsGetCurrentContext()];
    // Save the current image context info into a UIImage
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    // Save the screenshot to the device's photo album
    UIImageWriteToSavedPhotosAlbum(newImage, self,
                                   @selector(image:didFinishSavingWithError:contextInfo:), nil);
}

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {

    if (error) {
        // Handle if the image could not be saved to the photo album
    }
    else {
        // The save was successful and all is well
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM