android照片保存动画效果,android – 旋转动画后保存图像时如何避免闪烁图像?...

我混淆了翻译动画和旋转动画.在我的游戏中我使用这两个动画,完成动画后我保存了我的图像.在翻译动画中它很好,但在完成旋转动画后,我的图像闪烁一次.请看下面的代码,请解决我的问题……

为什么有人不回答我的问题,这是不明白的,或者我在问任何错误的问题?请告诉我原因……………..

谢谢.

Bitmap bmp=BitmapFactory.decodeResource(getResources(),R.drawable.train);

//1)

TranslateAnimation TAnimation=new TranslateAnimation(0, 0, 0,-100);//bottom to start

TAnimation.setInterpolator(new LinearInterpolator());

TAnimation.setDuration(2000);

TAnimation.setFillAfter(false);

TAnimation.setFillEnabled(true);

//TAnimation.setFillBefore(true);

Train.startAnimation(TAnimation);

TAnimation.setAnimationListener(new AnimationListener() {

public void onAnimationStart(Animation animation) {

}

public void onAnimationRepeat(Animation animation) {

}

public void onAnimationEnd(Animation animation) {

RelativeLayout RL=(RelativeLayout)findViewById(R.id.rl);

param=new RelativeLayout.LayoutParams( LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);

param.setMargins(x, y, 0, 0);

Train.setLayoutParams(param);

Train.setImageBitmap(bmp);

}

});

//x and y values are exact position of compliting translateanimation position

//2)

RotateAnimation RAnimation=new RotateAnimation(0,90,50,25);

RAnimation.setInterpolator(new LinearInterpolator());

RAnimation.setDuration(2000);

RAnimation.setFillAfter(false);

TAnimation.setFillEnabled(true);

//RAnimation.setFillBefore(true);

Train.startAnimation(RAnimation);

RAnimation.setAnimationListener(new AnimationListener() {

public void onAnimationStart(Animation animation) {

}

public void onAnimationRepeat(Animation animation) {

}

public void onAnimationEnd(Animation animation) {

RelativeLayout RL=(RelativeLayout)findViewById(R.id.rl);

param=new RelativeLayout.LayoutParams( LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);

param.setMargins(x, y, 0, 0);//x and y values are exact position of compliting translateanimation position

Train.setLayoutParams(param);

Train.setImageBitmap(bmp);

}

});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值