简体   繁体   中英

pan to a specific part of an image

i am trying to do the folowing: set up a large image (larger than the screen or zoomed in at some point) and by swiping left or right to be able to focus the users view to a specific part on the image(pan and zoom to that point). similar to the map view when you center on some location (or zoom to). any pointers for how i can achieve this?

i saw the zoom and swipe examples JohnNick has provided and went to search further and i found these 2 tutorials for creating scroll and zoom on an image

link Long-press and Scroll Large Images Using Low Level Events

link Large Image Scrolling Using Low Level Touch Events

but i still need a way to swipe to a specific part of an image. but now i have a dillema. as i read on there seem to be some issues with outOfMemoryException when working with large bitmaps, so my problem is: is it better to make the swipes as changing small bitmaps like the view transition example or is there a way to maybe only render the visible part of the image or something like that or maybe a map-like functionality ( dividing the image in ex. 8 parts and showing only the ones visible)?

Click Here Example for Image Zoom and Pan

Click Here Example for Image swiping

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM