5
一种方式做的是:如何以最佳方式缩放CGImage?
CGImageRef scaledImage(CGImageref, destination rect)
{
context = CGBitmapContextCreate(rect...);
CGContextDrawImage(context, rect);
return CGBitmapContextCreateImage(context)
}
问题:
创建位图背景可以是相当昂贵的,如果图像缩放操作非常频繁。有没有其他方法可以缩放CGimage?或者为缩放操作缓存这种位图上下文是唯一的选择?