Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Image move, zoom, pinch & overlay question
Started by ksan Apr 27 2013 12:11 PM

9 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Pro
  • PipPipPipPipPipPip
  • 2,712 posts
  • Jedi

Hi, 

 

I'm working on an festival guide type app. I have to display a map of the festival grounds. The current image I have is 1862 × 2048. I am able to show the image and zoom/pinch using the sample code PinchZoomGesture. I have not yet figured how to make it move. I'm guessing I have to put it into a ScrollView. I will probably find a sample to help me with this too. Can't believe how useful those samples are. 

 

Having said that I wondered if there is something in the code exchange since what I'm trying to achieve isn't that novel and ground breaking. Looked and looked but could not find anything like this. Am I missing something obvious?

 

Thank you very much for all your help. All the best!

 

Regards,

Kerem



[TOPIC: post.html]
#2

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Pro
  • PipPipPipPipPipPip
  • 2,712 posts
  • Jedi

At the risk of sounding as though I might be talking to myself... I was able to move the image horizontally and vertically using the ScrollView. Not perfect as most people would also move diagonally. Still looking to see if a sample / demo exists doing what I need. If you know one and can point me in the right direction I will be very very grateful. Thank you very much! 



[TOPIC: post.html]
#3

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Pro
  • PipPipPipPipPipPip
  • 2,712 posts
  • Jedi

Ok. I procastrinated on this scope element while taking care of other areas of my app but now it is time to tackle this one. Trying one last time to see this might catch somebody's attention. If you know of a sample that puts an image on screen, allows it to be pinch zoomed and moved around (ie dragged) I would love to get a pointer. Been looking high and low but could not find something like this. Thank you very much for your help!



[TOPIC: post.html]
#4

mfor1967

[GLOBAL: userInfoPane.html]
mfor1967
  • Pro
  • PipPipPip
  • 34 posts
  • Advanced Member

I'm in the same boat, did you find anything?  

 

I'm looking into opening up a storyboard overlay with an image so the user can zoom in and have a look around, then close it to get back to the page of text they were reading.



[TOPIC: post.html]
#5

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Pro
  • PipPipPipPipPipPip
  • 2,712 posts
  • Jedi

I found a sample in Code Exchange which allowed pinch/zoom/rotate. It was posted by horacebury. I think there are some more recent examples as well. Have you searched the code exchange?



[TOPIC: post.html]
#6

J. A. Whye

[GLOBAL: userInfoPane.html]
J. A. Whye
  • Pro
  • PipPipPipPipPipPip
  • 1,555 posts
  • Jedi

I know ScrollView only allows vertical and horizontal movement and I think I read somewhere here that diagonal is not something they're planning.

 

However, just grabbing an image and moving it around the screen isn't hard, so I'm thinking you should be able to ditch ScrollView and just do it manually. The only possible "hiccup" might be in making that happen along with the pinch/zoom stuff. But that's what I'd try.

 

 Jay



[TOPIC: post.html]
#7

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Pro
  • PipPipPipPipPipPip
  • 2,712 posts
  • Jedi


[TOPIC: post.html]
#8

mfor1967

[GLOBAL: userInfoPane.html]
mfor1967
  • Pro
  • PipPipPip
  • 34 posts
  • Advanced Member

Thanks for the links!  I was just reading https://gist.github.com/mikofh/7360955 too



[TOPIC: post.html]
#9

henrik5

[GLOBAL: userInfoPane.html]
henrik5
  • Starter
  • PipPipPipPipPipPip
  • 104 posts
  • Jedi

ksan: those have been removed, or the Code Exchange has b0rked its SEF link handling.

 

mfor1967: that code is a straight copy/paste from the Sample Code library that comes with Corona.

 

Still looking for a real-world example using scenes with display groups. Basically the only problem is the 'write it in mainline' style of all examples. I like to create the objects after the scene is created and then add listeners. Could some kind soul show how to avoid writing function object:touch(e) and remove self references in the example?

 

Edit: never mind, in tests it seemed a table listener was required. Some common features to add to the very limited example but I think I'll have no problem.



[TOPIC: post.html]
#10

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Pro
  • PipPipPipPipPipPip
  • 2,712 posts
  • Jedi

Yup. Seems like the old Code Exchange links are not working anymore which is a shame. There was so much in there that can still be reworked and used... 




[topic_controls]
[/topic_controls]