iOS - Pinch,Zoom,Drag Image - iPad - How?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
iOS - Pinch,Zoom,Drag Image - iPad - How?
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?
Does this do what you want?
Gerry
Gerry
- Attachments
-
- image Example.zip
- (92.57 KiB) Downloaded 918 times
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: iOS - Pinch,Zoom,Drag Image - iPad - How?
EXACTLY! Thanks for the example stack!
Re: iOS - Pinch,Zoom,Drag Image - iPad - How?
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.
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
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
What is wrong?
Salut,
Josep M
Re: iOS - Pinch,Zoom,Drag Image - iPad - How?
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
Dave
Re: iOS - Pinch,Zoom,Drag Image - iPad - How?
Hi,
I'm on iOS 4.3 and LC5.0. So better convert the image to PDF?
Salut,
Josep M
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?
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
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?
Hmmm. I don't know a way of getting the location or the zoom level of an image in a browser.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.
Are you using the stack I uploaded? Can you tell me what size image you are working with, and on what device?
Gerry
Last edited by Jellicle on Thu Mar 22, 2012 5:23 am, edited 1 time in total.
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: iOS - Pinch,Zoom,Drag Image - iPad - How?
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
I'm deploying to an IPhone using images from the picture folder.
Cheers
Re: iOS - Pinch,Zoom,Drag Image - iPad - How?
Thank-you Jellsie for your post. This is exactly what I needed.
-B
-B