Codesnipp.it Social Code Sharing

Scott Rapson

Create UIImage pragmatically

by Scott Rapson on Feb 18, 2011

//in the method file CGRect myImageRect = CGRectMake(0.0, 240.0, 320.0, 120.0); UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect]; [myImage setImage:[UIImage imageNamed:@"filename.png"]]; myImage.opaque = YES; // explicitly opaque for performance [self.view addSubview:myImage]; [myImage release];

Can't see the comments? Please login first :)