在动画的android位图图像 [英] Animating bitmap image in android
问题描述
我已经创建了一个圆形的位图图像,比我想的动画,所以我把它转换成bitmapdrawable,比把它添加到动漫drawable..But由于这种圆形状变为椭圆形..
I have created a bitmap image which is a circle and than as I wanted to animate it so i converted it into bitmapdrawable and than added it to animation drawable..But due to this the circle shaped has changed to oval shape...
所以,我应该怎么办?
是否有进行动画仅位图文件的任何其他方法。 ?
Is there any other method to animate only the bitmap file. ?
在此先感谢。
推荐答案
不,你不能动画位图
本身与机器人动画framwork
。您可以直接动画查看
s或的ViewGroup
和所有源自查看<类/ code>和
的ViewGroup
。
no, you can not animate the bitmap
itself with the android animation framwork
. You can directly animate View
s or ViewGroup
s and all the classes that derives from View
and ViewGroup
.
呼叫视图
的的ImageView
包含位图。
TranslateAnimation slide = new TranslateAnimation(view.getX(), view.getX() + 100, view.getY(), view.getY() + 100 );
slide.setDuration(1000);
view.startAnimation(slide)
这应该翻译的ImageView
按 100像素
从当前位置
that should translate the ImageView
by 100px
from the current position
这篇关于在动画的android位图图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!