Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)displayTwoImages {
- if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
- UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, NO, [UIScreen mainScreen].scale);
- }
- else UIGraphicsBeginImageContext(self.view.bounds.size);
- [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
- UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- UIImageView *topImage = [[UIImageView alloc] init];
- topImage.image = image;
- topImage.frame = CGRectMake(0, 0, 320, 215);
- topImage.layer.borderWidth = 5;
- // topImage.contentMode = UIViewContentModeTop;
- [self.view addSubview:topImage];
- [topImage release];
- UIImageView *bottomImage = [[UIImageView alloc] init];
- bottomImage.image = image;
- bottomImage.frame = CGRectMake(0, 215, 320, 216);
- bottomImage.layer.borderWidth = 5;
- // bottomImage.contentMode = UIViewContentModeBottom;
- [self.view addSubview:bottomImage];
- [bottomImage release];
- }
Add Comment
Please, Sign In to add comment