Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // UIImage *butterfly = [UIImage imageNamed:@"123.png"];
- //
- //
- //// CGRectMake(0, 0, [ [ UIScreen mainScreen ] bounds ].size.width, [ [ UIScreen mainScreen ] bounds ].size.height);
- //
- //
- UIImage *imageA = [UIImage imageNamed:@"123.png"];
- CGSize imageSize = imageA.size;
- CGFloat newWidth = (([[ UIScreen mainScreen ] bounds].size.height) / imageSize.height) * imageSize.width;
- // UIImageView *firstFrame = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, newWidth, [[ UIScreen mainScreen ] bounds].size.height)];
- // [firstFrame setImage:image];
- //// UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, newWidth, [[ UIScreen mainScreen ] bounds].size.height)];
- // UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, newWidth, [[ UIScreen mainScreen ] bounds].size.height)];
- // [newView setBackgroundColor:[UIColor colorWithPatternImage:butterfly]];
- //
- //
- UIGraphicsBeginImageContext(self.view.frame.size);
- // [[UIImage imageNamed:@"123.png"] drawInRect:self.view.bounds];
- [[UIImage imageNamed:@"123.png"] drawInRect:CGRectMake(0, 0, newWidth, [[ UIScreen mainScreen ] bounds].size.height)];
- UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- self.backgroundView.backgroundColor = [UIColor colorWithPatternImage:image];
- // [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"123.png"]]];
- // theImageView.contentMode = UIViewContentModeScaleAspectFill;
- // [self.view setMaskView:newView];
- // [backgroundView set:newView];
- // [theImageView setMaskView:firstFrame];
Advertisement
Add Comment
Please, Sign In to add comment