Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- totalWidth = [UIScreen mainScreen].bounds.size.width;
- M = totalWidth - rightMouthX;
- N = totalWidth - M;
- width = N - leftMouthX;
- totalHeight = [UIScreen mainScreen].bounds.size.height;
- P = totalHeight - bottomMouthY;
- Q = totalHeight - P;
- height = Q - centerMouthY;
- NSArray *dimentionArray = @[
- [NSNumber numberWithFloat:leftMouthX],
- [NSNumber numberWithFloat:leftMouthY],
- [NSNumber numberWithFloat:width],
- [NSNumber numberWithFloat:height *2]
- ];
- [DrawingUtility addRectangle:faceRect
- toView:self.overlayView
- withColor:[UIColor clearColor]withImageViewDimention:dimentionArray];
- + (void)addRectangle:(CGRect)rect
- toView:(UIView *)view
- withColor:(UIColor *)color
- withImageViewDimention:(NSArray *)dimention{
- UIView *newView = [[UIView alloc] initWithFrame:rect];
- newView.layer.cornerRadius = 10;
- newView.alpha = 0.3;
- newView.backgroundColor = color;
- [view addSubview:newView];
- UIImageView *imgView = [[UIImageView alloc]init];
- if (dimention) {
- imgView.frame = CGRectMake([[dimention objectAtIndex:0] floatValue], [[dimention objectAtIndex:1] floatValue], [[dimention objectAtIndex:2] floatValue], [[dimention objectAtIndex:3] floatValue]);
- }
- imgView.image = [UIImage imageNamed:@"lips.png"];
- [view addSubview:imgView];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement