开发者

UIGraphicsGetImageFromCurrentImageContext , alloc version?

UIGr开发者_如何学运维aphicsGetImageFromCurrentImageContext returns autoreleased UIImage.

Wonder if there is a way to get "alloc"-ed image from context?

I want something equivalent to following code, maybe the code is best I can do?

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];     
UIImage* image = get image by UIGraphicsGetImageFromCurrentImageContenxt
[image retain];
[pool release];


Just call -retain on the result.

UIImage *image = [UIGraphicsGetImageFromCurrentImageContext() retain];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜