Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • resize UIImage without losing quality (not screenshot)

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 833
    Comment on it

    Use the below code for cutting UIImage in high quality without blur (not screenshot)

    tmp is image view

    <p>UIGraphicsBeginImageContextWithOptions(tmp.frame.size,YES, 4.0);</p>
    
    <p>CGContextRef c = UIGraphicsGetCurrentContext();</p>
    
    <p>CGContextConcatCTM(c, CGAffineTransformMakeTranslation(-tmp.frame.origin.x, -tmp.frame.origin.y));</p>
    
    <p>[view.layer renderInContext:UIGraphicsGetCurrentContext()];</p>
    
    <p>UIImage * img = UIGraphicsGetImageFromCurrentImageContext();</p>
    
    <p>UIGraphicsEndImageContext();</p>
    
     img will be the high quality image with no blur. 
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: