IOS _ screenshot and cropping, and iOS _ screenshot Cropping

Source: Internet
Author: User

IOS _ screenshot and cropping, and iOS _ screenshot Cropping

Use Cases:



Code segment in iOS 7

// Use the context and crop by using the specified region. The template code-(void) screenShot {// view to be taken, that is, the view of the window root controller (which must not include the status bar, the Controller in ios7 contains the status bar by default.) BeyondViewController * beyondVC = self. view. window. rootViewController; // The total size of the background image CGSize = beyondVC. view. frame. size; // enable the context. After parameters are used, the source image (YES 0.0 high quality) uigraphicsbeginimagecontextwitexceptions (size, YES, 0.0) is captured. // key code for cropping, the range of the rectangle to crop CGRect rect = CGRectMake (0,-20, size. width, size. height + 20); // Note: renderInContext after iOS7: replaced by [beyondVC. view drawViewHierarchyInRect: rect afterScreenUpdates: NO]; // obtain the UIImage * snapshot = screenshot () from the context; // Add the captured image to the Image array [_ cutImages addObject: snapshot]; // remember, end context (remove stack top context) UIGraphicsEndImageContext ();}


Code snippets in iOS 6

// Use context, template code-(void) screenShot3 {// view to be taken, view of the window root controller (iOS6, default controller does not include the status bar) BeyondViewController * beyondVC = self. view. window. rootViewController; UIView * cutView = beyondVC. view; // enable the context. After parameters are used, the source image (YES 0.0 high quality) uigraphicsbeginimagecontextwitexceptions (cutView. frame. size, YES, 0.0); // render the layer of the cutView to the context [cutView. layer renderInContext: UIGraphicsGetCurrentContext ()]; // retrieve the UIImage * image = seek (); // Add the captured image to the image array [_ cutImages addObject: image]; // remember to end the context UIGraphicsEndImageContext ();}


Ios screenshot Software

Iphone itouch comes with the high-definition screenshot function. We recommend that you read more instructions,
Press and hold the home Key (the big button), and then press the power key (above the body) to see the screen flashing .. Screenshot taken successfully!

How to Use ipad4 regional screenshots?

Ios devices do not support area screenshots. You can only crop the entire screen after it is captured.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.