Android的,移动的位图沿路径?位图、沿路、Android

由网友(唐僧洗头爱飘柔灬)分享简介:我想知道是否有可能从路径选择的坐标绘制位图随着时间的推移,例如,我有一个阳光的形象,我想移动它,随着时间的推移,沿弧形路径有没有一些方法来定义这样的路径,然后沿着它移动,这样我就不用数学计算呢?感谢。解决方案 我在想一个解决办法:_/ \如果您的圆弧有这种形状的(意思是不到半圈,定位horizo​​ntaly),那么...

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

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

感谢。

解决方案

我在想一个解决办法:

  _
       / 
 

如果您的圆弧有这种形状的(意思是不到半圈,定位horizo​​ntaly),那么你可以遍历的x值和使得x得到y表示的路径上。那么你的位图移动到该位置。

Android移动开发技术文章 手机开发

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.

阅读全文

相关推荐

最新文章