在动画的android位图图像 [英] Animating bitmap image in android

查看:133
本文介绍了在动画的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 Views or ViewGroups 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屋!

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