0
我需要您的幫助才能在iOS上的其他圖像中繪製圖像。爲了這一刻,我使用下面的代碼:在其他圖像中繪製圖像不適用於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不繪製。有任何想法嗎 ?
你說得對,文件名有問題......謝謝;) – Aloa77 2012-07-31 09:32:39