Android,沿路径移动位图? [英] Android, move bitmap along a path?

查看:34
本文介绍了Android,沿路径移动位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以从路径中选择坐标以随时间绘制位图,例如,我有一个太阳的图像,我想随着时间的推移沿着弧形路径移动它.

有没有办法定义这样的路径然后沿着它移动,这样我就不必用数学方法计算它?

谢谢.

解决方案

我在想一个解决方案:

<块引用>

 _/\

如果您的弧形具有这种形状(意味着小于半个圆并水平放置),那么您可以迭代 x 值,并为该 x 获取路径上的 y.然后将您的位图移动到该位置.

I would like to know if it's possible to select coordinates from a path to draw a bitmap over time, for example, I have an image of a sun, and I would like to move it, over time, along an arc path.

Is there some way to define a path like this and then move along it, so that I don't have to calculate it mathematically?

Thanks.

解决方案

I'm thinking of one solution:

         _
       /   \

If your arc has this kind of shape (meaning less than half a circle and positioned horizontaly) then you could iterate the x value and for that x get the y that's on the path. Then move your bitmap to that position.

这篇关于Android,沿路径移动位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆