CGBitmapContextCreate返回nil

2019-03-18  本文已影响0人  人莫予毒_dfc6

    CGContextRef ctx = CGBitmapContextCreate(

                                             outBuffer.data,

                                             outBuffer.width,

                                             outBuffer.height,

                                             bitsPerComponent,

                                             outBuffer.rowBytes,

                                             colorSpace,

                                             kCGImageAlphaNoneSkipLast);

可以试试把 outBuffer.rowBytes改为 outBuffer.width * 4或者把 colorSpace改为 CGImageGetColorSpace(img)。

上一篇 下一篇

猜你喜欢

热点阅读