使用ImageView进行全景视图
是否可以使用ImageView绘制全景图? IE 当您滚动到全景图片右边缘的末尾时,它应该开始显示图片的左边缘。我知道有一个 android 的全景项目,但我正在考虑手动执行此操作。现在,我可以使用 Android 的矩阵进行滚动和缩放。
Is it possible to use ImageView to draw a panoramic picture? I.E. When you scroll to the end of the right edge of a panoramic picture, it should start showing the left edge of the picture. I know there is a panoramicgl project for android, but I was thinking of doing this manually. Right now, I have scrolling and zooming using Android's matrix.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,这是可能的,但你也需要有一个滚动视图。
Yes that is possible, but you need to have a scrollview too.
您可以尝试子类化 ImageView 并实现 onTouchEvent() 来监听将修改当前焦点的用户输入。如果焦点移动,则将图片重新绘制到屏幕外位图,例如使用matrix.postTranslate(deltaX,deltaY),并重新绘制图像中已移出另一侧边界的部分。
You could try to subclass ImageView and implement onTouchEvent() to listen to userinput that will modify the current focal point. If the focal point is moved, redraw the picture to an offscreenbitmap, e.g. with matrix.postTranslate(deltaX,deltaY), and redraw the portion of the image that has been shifted out of bounds on the opposite side.