UIImageView
Creating a view for images
UIImage *image = [UIImage imageNamed:@"image.png"];
UIImageView *theImageView = [[UIImageView alloc] initWithImage:image];
UIImage *image = [UIImage imageNamed:@"image.png"];
UIImageView *theImageView = [[UIImageView alloc] initWithImage:image];
Comments
UIImage* bottomImage = [UIImage imageNamed:@"bottom.png"];
UIImage* topImage = [UIImageNamed:@"top.png"];
UIImageView* imageView = [[UIImageView alloc] initWithImage:bottomImage];
UIImageView* subView = [[UIImageView alloc] initWithImage:topImage];
subView.alpha = 0.5; // Customize the opacity of the top image.
[imageView addSubview:subView];
UIGraphicsBeginImageContext(imageView.frame.size);
[imageView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage* blendedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[subView release];
[imageView release];
[self doWhateverIWantWith: blendedImage];
iPhone : warning: no ‘-renderInContext:’ method found – solution
with one comment
for above comment
There is a simple solution to this pesky warning:
1. Add the following to your .h file :
#import
2. You may also need to add “CoreGraphics.framework” to your project, if its not already there.
Post a Comment