The app I'm working on requires me to draw images to a UIView. These images are large (some are 1024x768), and I'd like to be sure my drawing code isn't sub-optimal. My drawRect method in my UIView looks like this:
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextClearRect(context, rect);
CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, 550);
CGContextConcatCTM(context, flipVertical);
CGImageRef shadowImage = [[UIImage imageNamed:@"someimage.png"] CGImage];
CGContextDrawImage(context, CGRectMake(162, -174, 700, 700), shadowImage);
CGContextConcatCTM(context, flipVertical);
}
There is other drawing done here too, but I just want to be sure that the image drawing code isn't going to cause problems, and I haven't neglected to call an important method or implemented this incorrectly.