采取异步线程拼接多个高清大图,使用CoreGraphics绘制,关键api如下:
CGContextRef CGBitmapContextCreate(void * data,
size_t width, size_t height, size_t bitsPerComponent, size_t bytesPerRow,
CGColorSpaceRef space, uint32_t bitmapInfo)
其中对于bytesPerRow,如果是横向拼接,这个值为width*4,导致内存会变得非常大,而且容易导致渲染失败。
建议对于横向拼接,先转换坐标系,转换成纵向拼接,渲染出图像后再变换方向。