iOS code screenshot blur Problem Solving method

Source: Internet
Author: User

The methods we use are as follows:

Dimensions are in accordance with

Uigraphicsbeginimagecontext (Cgsizemake (+) );     // CurrentView The current view  creates a bitmap-based graphics context and specifies a size of    [Self.view.layer Renderincontext:uigraphicsgetcurrentcontext ()]; // Renderincontext renders the recipient and its child scopes to the specified context    UIImage *viewimage = Uigraphicsgetimagefromcurrentimagecontext (); // returns a picture    based on the current drawing context Uigraphicsendimagecontext (); // removes the top of the stack based on the current bitmap's graphics context    Uiimagewritetosavedphotosalbum (viewimage, nil, nil, nil); // then save the picture to a picture map

This method is relatively simple and generally uses this method

But there may be a more stringent clarity requirement then we need to modify this method as follows:

Uigraphicsbeginimagecontextwithoptions (Cgsizemake,0.0//  CurrentView The current view  creates a bitmap-based graphics context and specifies a size of    [Self.view.layer Renderincontext: Uigraphicsgetcurrentcontext ()]; // Renderincontext renders the recipient and its child scopes to the specified context    UIImage *viewimage = Uigraphicsgetimagefromcurrentimagecontext (); // returns a picture    based on the current drawing context Uigraphicsendimagecontext (); // removes the top of the stack based on the current bitmap's graphics context    Uiimagewritetosavedphotosalbum (viewimage, nil, nil, nil); // then save the picture to a picture map

The main uigraphicsbeginimagecontextwithoptions method has changed:

This should be the IOS7 and the way to set the resolution later

The screen images captured in the method below will be clearer

iOS code screenshot blur Problem Solving method

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.