Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to take an iPhone screenshot of entire view including parts off screen?

I have an application that's laid out using an UITableView. The interface takes up more than just the screen, so there's some area that can be scrolled to. I would like some screenshots of the entire view (including the non-visible area) to use for documentation and soliciting feedback from my customer.

Is there programmatic way to get an image of the entire view? I don't think there would be a way on the device to do this, but maybe there is.

like image 857
Beardo Avatar asked Feb 24 '10 17:02

Beardo


People also ask

How do you take a full page view on iPhone?

Save a full-page screenshot as a PDF On an iPhone with Face ID: Simultaneously press and then release the side button and volume up button. On an iPhone with a Home button: Simultaneously press and then release the Home button and side button.

How do you take a long text screenshot on iPhone?

On your iPhone, go to the page you want an extended screenshot from. Press the power and volume up buttons together on your iPhone like you would typically to grab a screenshot. Touch the screenshot's floating thumbnail on the bottom-left corner.


1 Answers

Just pasting some code I used in my app. It draws a view to an image (potentially scaling). Maybe you could programmaticaly scroll the table and stitch the images together in the end or something similar:

+ (UIImage *)captureView: (UIView *)view inSize: (CGSize)size
{
    UIGraphicsBeginImageContext(size);
    CGSize viewSize = view.frame.size;
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextScaleCTM( context, size.width/viewSize.width, size.height/viewSize.height);

    [view.layer renderInContext: UIGraphicsGetCurrentContext()];

    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return viewImage;
}

Hope it helps

like image 147
Plamen Dragozov Avatar answered Nov 15 '22 04:11

Plamen Dragozov