我需要您的帮助才能在 iOS 上的另一个图像中绘制图像。此刻,我使用下面的代码:
UIImage* finalimage = [self drawImage:ECAImage inImage:finalimage atPoint:ECALocation];
我的功能:
-(UIImage*) drawImage:(UIImage*) fgImage inImage:(UIImage*) bgImage atPoint:(CGPoint) point
{
UIGraphicsBeginImageContextWithOptions(bgImage.size, FALSE, 0.0);
[bgImage drawInRect:CGRectMake( 0, 0, bgImage.size.width, bgImage.size.height)];
[fgImage drawInRect:CGRectMake( point.x, point.y, fgImage.size.width, fgImage.size.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
此代码适用于 iPhone 5.0 模拟器,但不适用于我的设备 iPhone 5.0.1。我可以显示 bgImage 但 fgImage 没有绘制。有任何想法吗 ?