Guest User

Untitled

a guest
Feb 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. //Based on documentation I know that I have to create an instance from
  2. UIGraphicsImageRendererFormat and set its scale to my desired scale but how can I use it???
  3.  
  4. UIGraphicsImageRendererFormat * format = [UIGraphicsImageRendererFormat defaultFormat];
  5. format.scale=1.0;
  6. UIGraphicsImageRenderer*renderer = [[UIGraphicsImageRenderer alloc]initWithBounds:self.bgImageView.layer.bounds];
  7.  
  8. UIImage*image= [renderer imageWithActions:^(UIGraphicsImageRendererContext*_Nonnull myContext){
  9. [self.bgImageView.layer renderInContext: myContext.CGContext];
  10. }];
Add Comment
Please, Sign In to add comment