PDA

View Full Version : Does the magnifying glass work on images




imPoddible
Jan 18, 2009, 06:54 PM
You see that funky magnifying glass that pops up when you're editing text?

Well, can that be used to move around an image? For example, suppose I had a full screen image, could I then scroll around that image with the magnifying glass following my finger movements?

How difficult would this be to implement in an application?

Thanks!

imPoddible.



xsmasher
Jan 18, 2009, 09:22 PM
You see that funky magnifying glass that pops up when you're editing text?

Well, can that be used to move around an image? For example, suppose I had a full screen image, could I then scroll around that image with the magnifying glass following my finger movements?

Not the magnifying glass, but UIScrollView lets you scroll around a larger area, and zoom/pinch. It's what's used in the photo app, where you can zoom/pinch a photo.

PhoneyDeveloper
Jan 19, 2009, 09:06 AM
The functionality of that magnifying glass isn't exposed in the SDK so you'd have to implement it yourself.

Many years ago I wrote something similar for MacOS. If you have an offscreen version of the onscreen image then it becomes a matter of compositing a region of the offscreen onto the onscreen view. Actually it might be simpler to have a view with transparency to make it appear circular and then to blit from the offscreen higher res image to this viewport. How hard that is to do depends on your background but I think the hardware and OS would be up to it, depending on how big your magnifying glass needs to be.

imPoddible
Jan 19, 2009, 09:54 AM
Not the magnifying glass, but UIScrollView lets you scroll around a larger area, and zoom/pinch. It's what's used in the photo app, where you can zoom/pinch a photo.

Thanks for the response - yup I toyed with the idea of implementing things this way but for the look I want to achieve, it's not quite right.

The functionality of that magnifying glass isn't exposed in the SDK so you'd have to implement it yourself...

...How hard that is to do depends on your background but I think the hardware and OS would be up to it, depending on how big your magnifying glass needs to be.

Hmmm.... OK - that's sounds like what I'll have to do. I have no idea *how* I'm going to do it, but I'll give it a try! Shame it's not implemented in the SDK.

Thanks both for the feedback - much appreciated!

imPoddible.