GLPaint save image

后端 未结 5 1265
南笙
南笙 2021-01-31 23:39

I\'m trying to develop a complex painting application on the iPhone. I\'m currently drawing using Quartz (e.g. CGContext...). Unfortunately the Quartz overhead is

5条回答
  •  无人及你
    2021-02-01 00:44

    It's definitely possible. The trick is to use glReadPixels to pull the image data out of the OpenGL framebuffer into memory you can use. Once you have a pointer to the image data, you can use CGDataProviderCreateWithData and CGImageCreate to create a CGImage from the data. I'm working on an OpenGL-based drawing app that uses this technique a lot!

提交回复
热议问题