开发者

Quartz2D: How to draw into a bitmap context and show result without copying

开发者 https://www.devze.com 2023-03-29 22:17 出处:网络
For any paint program you need to be able to dr开发者_如何学JAVAaw lines in response to user gestures.

For any paint program you need to be able to dr开发者_如何学JAVAaw lines in response to user gestures.

Is there any way to subsequently draw into the same bitmap and show the result, e.g., with a UIImageView without copying the bits with every stroke?

I tried to create a bitmap context CGBitmapContextCreate and then set a UIImageView's image by CGBitmapContextCreateImage. But unfortunately, CGBitmapContextCreateImage does also make a copy. There is a hint in the documentation that it might be possible to omit the copying. But I have yet failed to make it work. Does anybody know how this is done without the performance burden of copying?

0

精彩评论

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

关注公众号