Implementing a "magnifier glass" type of UI control

510 views Asked by At

I am implementing an eye glass / zoom type of control that lets you see portions of an other UIView magnified.

Implemented a solution that does this by taking a screenshot of the main UIView and then shows only portion of that screenshot in the magnifier.

However, this implementation is very inefficient, as I move the touch around there is a noticeable slowdown before and after this change.

Looking at other methods to do this. Anyone has any suggestions?

There are two things that I am looking at right now:
1. CAReplicatorLayer: Is it possible to do this with a replicator layer?
2. Partial screenshots: How do you take partial screenshots of another UIView/layer?

Anyone has any other suggestions on how this can be implemented?

Regards!

1

There are 1 answers

0
ZhangChn On

See the source code of EGOTextView, where a magnifier glass effect was implemented upon a customized rich-text view.