开发者

error in CGBitmapContextCreate

开发者 https://www.devze.com 2023-03-30 03:05 出处:网络
i\'m trying to create UIImage from the sampleBufferData and here what i have in the console : CGBitmapContextCreate: invalid data bytes/row: should be at least 1920 for 8 integer bits/component, 3 co

i'm trying to create UIImage from the sampleBufferData and here what i have in the console

: CGBitmapContextCreate: invalid data bytes/row: should be at least 1920 for 8 integer bits/component, 3 components, kCGImageAlphaPremultipliedFirst.

: CGBitmapContextCreateImage: invalid context 0x0

here is my code

// Create a b开发者_运维知识库itmap graphics context with the sample buffer data
CGContextRef context = CGBitmapContextCreate(baseAddress, width, height, 8, 
  bytesPerRow, colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); 
// Create a Quartz image from the pixel data in the bitmap graphics context
CGImageRef quartzImage = CGBitmapContextCreateImage(context);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号