Bha*_*uja 5 core-graphics image-processing ios
一种方法是:
CGImageRef scaledImage(CGImageref, destination rect)
{
context = CGBitmapContextCreate(rect...);
CGContextDrawImage(context, rect);
return CGBitmapContextCreateImage(context)
}
Run Code Online (Sandbox Code Playgroud)
问题:
如果图像缩放操作非常频繁,则创建位图上下文可能非常昂贵.有没有其他方法可以扩展CGimage?或者缓存这样的位图上下文以进行缩放操作是唯一的选择吗?