开发者

How do I save the state of a UIImage or UIImageView?

So I've let the user transform a UIImage inside of my custom TransformView which is a subclassed UIImageView. It allows the user to rotate, scale, and pan using touchesEnded, touchesMoved, etc. Now what I'm trying to do, because my image is so large and takes up too much memory, is to remove it from view and set it to nil when the user switches tabs.

How do I save the state of the image so that it can load again from the same position? I want i开发者_Python百科t to have the same zoom level, rotation, and position on screen. Any thoughts? Thanks so much!


It depends on how you did your transformations. If you were doing them using CATransform's them the image change won't affect them. But if you were drawing into context, then you probably want to save the context.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜