这是纹理吗?
现在我的应用程序看起来像这样
我做了什么http://i56.tinypic.com/6577zd.png
(它是一个设置为背景的图像和一个ImageView。每次触摸ImageView时,背景都会改变,因此人会“旋转”)。如何将图像中的某些区域处理为如下所示:
这是纹理吗?我提到,当人旋转时(背景发生变化),某些区域会发生变化……所以这意味着每次触摸 ImageView 时,该图像的尺寸都会发生变化。
欢迎任何想法。现在我被困在这里,我不知道该怎么办。
Now my app looks like this
What I did http://i56.tinypic.com/6577zd.png
(it is a image set as background and an ImageView. Every time the ImageView is touch, the background is changing, so the person is "rotating"). How can I mach some regions from image to look like this:
Are this textures? I mention that there areas are changing when the person is rotating (background is changed)...so this means that the dimension of this images is changing every time the ImageView is touch.
Any idea is welcome. Now I am block here and i don't know what to do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要通过添加半透明图层来组合图像。
您可以使用任何 2D API 或 OpenGL 轻松实现这一点,只需使用任何 ARGB 颜色模型并将 Alpha 通道设置为 50%,然后用矩形进行绘制。
至于定位,那是你自己要根据图像的变化情况来确定的。如果您有一小组图像,也许最简单的方法是将手动生成的坐标映射记录在某个配置文件中;否则你将需要处理一些令人讨厌的图像识别问题......
You need to compose your image by adding semi-translucent layers.
You can achieve that easily with any 2D API or with OpenGL, just use any ARGB colour model and set the Alpha channel to 50% for example, then and paint over with the rectangles.
About the positioning, that is something that you should work out by yourself, depending on how the image is changing. If you have a small set of images, maybe the easiest way is to record the hand-generated coordinate mappings in some configuration file; otherwise you'll need to deal with some nasty image-recognition problems...