简体   繁体   English

CGBitmapContextCreate警告

[英]warning on CGBitmapContextCreate

CGColorSpaceRef colorSpace = CGImageGetColorSpace([UIImage imageNamed:@"shirtWhite.jpeg"]); 
    CGContextRef context = CGBitmapContextCreate (nil,
                                                  width,
                                                  height,
                                                  CGImageGetBitsPerComponent(imageToTest.image),
                                                  CGImageGetBytesPerRow(imageToTest.image),
                                                  colorSpace,
                                                  CGImageGetAlphaInfo(imageToTest.image));

I got the warning on each line where I am passing the image. 我在传递图像的每一行都收到警告。 The warning is " warning: passing argument 1 of 'CGImageGetColorSpace' from incompatible pointer type 警告是“警告:从不兼容的指针类型传递'CGImageGetColorSpace'的参数1

warning: passing argument 1 of 'CGImageGetBitsPerComponent' from incompatible pointer type 警告:从不兼容的指针类型传递“ CGImageGetBitsPerComponent”的参数1

"

解决:传递CGImage而不是图像

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM