سؤال

I'm trying to create a CGContextRef using CGBitmapContextCreate. The bitmap I want to create is RBG565 (red and blue are 5 bits, green is 6 bits). One of the parameters for CGBitmapContextCreate is bitsPerComponent. Since I have variable bitsPerComponent, I'm not sure if I just set it as 5, or is there a better way to do it?

Thanks.

هل كانت مفيدة؟

المحلول

CoreGraphics doesn't support RGB565 natively. You'll need to create your bitmap context with a different format and then convert to RGB565 using something like vImageConvert_ARGB8888toRGB565.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top