Page 1 of 1

iOS - Pinch,Zoom,Drag Image - iPad - How?

Posted: Mon Feb 27, 2012 9:37 pm
by cenglish
I have exhausted myself trying to figure out how to simply take an image, and allow a user to pinch to zoom in (and out) while rescaling the image to not lose quality. I am pulling image links from a cloud and putting them into an image and then I need that image to be able to *smoothly* be able to be zoomed in (and out) without having it go all over the place. I tried using the code used in the LiveCode Lessons for multitouch, changed the "graphics" to "image" but it was jumpy bad. And even then, I could only zoom into one spot and not move around the zoomed in image. I tried adding a "grab me" along with the zooming, but that made the image jump all over the place. I came across multiple scripts to zoom in and out of an image, but couldn't find anything that would allow the zoom in and out with moving around the image AND not losing image quality. Any feedback or example stacks would be greatly appreciated. Thanks

Re: iOS - Pinch,Zoom,Drag Image - iPad - How?

Posted: Mon Feb 27, 2012 10:59 pm
by Jellicle
Does this do what you want?

Gerry

Re: iOS - Pinch,Zoom,Drag Image - iPad - How?

Posted: Tue Feb 28, 2012 6:20 pm
by cenglish
EXACTLY! Thanks for the example stack!

Re: iOS - Pinch,Zoom,Drag Image - iPad - How?

Posted: Sat Mar 17, 2012 8:01 pm
by JosepM
Hi,

I testing the presentation of images using the UIWebView control. I want zoom more the image but ever the zoom factor is the same.
I try with images at 2048x1536 with 150p but I can't get more zoom.

I try using the sample stack from this post.

Code: Select all

on preopencard
   global mScrollerId
   iphoneControlCreate "browser"
   put the result into mScrollerId
   iphoneControlSet mScrollerId, "visible", "true"
   iphoneControlSet mScrollerId, "canBounce", "true"
   iphoneControlSet mScrollerId, "autoFit", true  
   iphoneControlSet mScrollerId, "rect", (the left of this card , the top of this card, the right of this card , 724) --the bottom of this card )
   put "file://" & specialFolderPath("engine")&"/MAGAZINE_PAGE_2.jpg"  into  localURL
   replace " " with "%20" in localURL
   iphoneControlSet mScrollerId, "url", localURL
end preopencard
The 724 limit is to left some menu bar and for capture the swipe gesture, so over the browser control I can't trap it.

What is wrong?

Salut,
Josep M

Re: iOS - Pinch,Zoom,Drag Image - iPad - How?

Posted: Sat Mar 17, 2012 11:43 pm
by FireWorx
I haven't tried your stack (dont have the time right now) but I do know that there was a major improvement in IOS system 5.0 and LiveCode 5.0 when it came to zooming in deep on a PDF in a browser. Also major imrovements in the speed of which the image rendered. Are you using LC 5.0 or better?
Dave

Re: iOS - Pinch,Zoom,Drag Image - iPad - How?

Posted: Tue Mar 20, 2012 1:17 am
by JosepM
Hi,

I'm on iOS 4.3 and LC5.0. So better convert the image to PDF?

Salut,
Josep M

Re: iOS - Pinch,Zoom,Drag Image - iPad - How?

Posted: Tue Mar 20, 2012 9:56 pm
by Batninja
Hi

Thanks for the pinch zoom code via browser. It is very smooth but I need to know the final size and location of the zoomed and moved image to use in a print out. I too have had problems getting sample code to work smoothly and not jump.

Any ideas or suggestions would be greatly welcomed.

Thanks

Roger

Re: iOS - Pinch,Zoom,Drag Image - iPad - How?

Posted: Wed Mar 21, 2012 3:13 am
by Jellicle
Batninja wrote:but I need to know the final size and location of the zoomed and moved image to use in a print out. I too have had problems getting sample code to work smoothly and not jump.
Hmmm. I don't know a way of getting the location or the zoom level of an image in a browser.

Are you using the stack I uploaded? Can you tell me what size image you are working with, and on what device?

Gerry

Re: iOS - Pinch,Zoom,Drag Image - iPad - How?

Posted: Wed Mar 21, 2012 10:09 pm
by Batninja
Hi, your browser code works great, but I can't see how to get the final image size and coordinates either (and if you can't then there's no hope for me lol)

I'm deploying to an IPhone using images from the picture folder.

Cheers

Re: iOS - Pinch,Zoom,Drag Image - iPad - How?

Posted: Tue Jul 24, 2012 7:06 am
by bmatichuk
Thank-you Jellsie for your post. This is exactly what I needed.

-B