UIGraphicsGetCurrentContext线程问题 [英] UIGraphicsGetCurrentContext threading problem

查看:40
本文介绍了UIGraphicsGetCurrentContext线程问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考资料中这样说:您只能从应用程序的主线程调用此函数."
但是我想从单独的线程中获取当前的图形上下文.你怎么看?我该怎么办?

The reference says this: "You should call this function from the main thread of your application only."
But I would like to get the current graphics context from separate threads. What do you think? What can I do to reach this?

谢谢你们的答案.我目前不知道哪个对我有好处,但非常感谢.

Thanks guys for the answers. I don't know which is good for me at the moment, but thank you very much.

推荐答案

如果要从其他线程绘制,请创建自己的CGBitmapContext或使用CATiledLayer.

If you want to draw from other threads, either create your own CGBitmapContext or use a CATiledLayer.

这篇关于UIGraphicsGetCurrentContext线程问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆