bitblit

How to render to offscreen bitmap then blit to screen using Core Graphics

穿精又带淫゛_ 提交于 2019-11-29 01:22:20
I would like to render to an offscreen bitmap (or array of RGBA values) and then blit those to a UIView during in the view's drawRect function. I would prefer to do full 32-bit rendering (including alpha channel), but would also be content with 24-bit rendering. Would anyone mind pointing me in the right direction with some code snippets or relevant APIs? Also, I know exactly how to do this using OpenGL - I would just prefer to do this work in Core Graphics itself. To render into an offscreen context and save it as a CGImageRef: void *bitmapData = calloc(height, bytesPerLine); CGContextRef

How to render to offscreen bitmap then blit to screen using Core Graphics

喜你入骨 提交于 2019-11-27 15:49:12
问题 I would like to render to an offscreen bitmap (or array of RGBA values) and then blit those to a UIView during in the view's drawRect function. I would prefer to do full 32-bit rendering (including alpha channel), but would also be content with 24-bit rendering. Would anyone mind pointing me in the right direction with some code snippets or relevant APIs? Also, I know exactly how to do this using OpenGL - I would just prefer to do this work in Core Graphics itself. 回答1: To render into an