官方参考:https://developer.apple.com/library/archive/samplecode/LargeImageDownsizing/Introduction/Intro.html
要点
- 异步线程中创建context,通过以下方法分块获取图片,并将图片绘制到context中:
// create a reference to the source image with its context clipped to the argument rect.
sourceTileImageRef = CGImageCreateWithImageInRect( sourceImage.CGImage, sourceTile );
- 每绘制一小块图片,在主线程中通过context创建图片,然后显示出来
网友评论