Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. totalWidth = [UIScreen mainScreen].bounds.size.width;
  2. M = totalWidth - rightMouthX;
  3. N = totalWidth - M;
  4. width = N - leftMouthX;
  5.  
  6. totalHeight = [UIScreen mainScreen].bounds.size.height;
  7. P = totalHeight - bottomMouthY;
  8. Q = totalHeight - P;
  9. height = Q - centerMouthY;
  10.  
  11. NSArray *dimentionArray = @[
  12. [NSNumber numberWithFloat:leftMouthX],
  13. [NSNumber numberWithFloat:leftMouthY],
  14. [NSNumber numberWithFloat:width],
  15. [NSNumber numberWithFloat:height *2]
  16. ];
  17.  
  18. [DrawingUtility addRectangle:faceRect
  19. toView:self.overlayView
  20. withColor:[UIColor clearColor]withImageViewDimention:dimentionArray];
  21.  
  22. + (void)addRectangle:(CGRect)rect
  23. toView:(UIView *)view
  24. withColor:(UIColor *)color
  25. withImageViewDimention:(NSArray *)dimention{
  26.  
  27.  
  28. UIView *newView = [[UIView alloc] initWithFrame:rect];
  29. newView.layer.cornerRadius = 10;
  30. newView.alpha = 0.3;
  31. newView.backgroundColor = color;
  32. [view addSubview:newView];
  33.  
  34. UIImageView *imgView = [[UIImageView alloc]init];
  35. if (dimention) {
  36.  
  37. imgView.frame = CGRectMake([[dimention objectAtIndex:0] floatValue], [[dimention objectAtIndex:1] floatValue], [[dimention objectAtIndex:2] floatValue], [[dimention objectAtIndex:3] floatValue]);
  38. }
  39.  
  40. imgView.image = [UIImage imageNamed:@"lips.png"];
  41.  
  42. [view addSubview:imgView];
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement