Creating a bitmap image of a view


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. UIGraphicsBeginImageContext(srcView.bounds.size);
  2. [srcView.layer renderInContext:UIGraphicsGetCurrentContext()];
  3. UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
  4. UIGraphicsEndImageContext();
  5.  
  6. UIImageView* proxy = [[UIImageView alloc] initWithImage:viewImage];

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.