美文网首页
iOS大图绘制

iOS大图绘制

作者: liboxiang | 来源:发表于2019-04-03 23:43 被阅读0次

官方参考: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创建图片,然后显示出来

相关文章

网友评论

      本文标题:iOS大图绘制

      本文链接:https://www.haomeiwen.com/subject/jthxiqtx.html