如何适应GIF文件在Android的屏幕尺寸文件、屏幕尺寸、GIF、Android

由网友(-少年多梦不多情、)分享简介:我玩的GIF动画文件中使用的电影类,但在屏幕上可能不适合。I am playing gif animation file using movie class, but could not fit with in screen.如何扩展或合适的gif文件,屏幕大小?How to scale or fit gif f...

我玩的GIF动画文件中使用的电影类,但在屏幕上可能不适合。

I am playing gif animation file using movie class, but could not fit with in screen.

如何扩展或合适的gif文件,屏幕大小?

How to scale or fit gif file to screen size ?

我已经GIF视图自定义视图,并使用mvoie类播放动画。

I have taken GIF view custom view and playing animation using mvoie class.

推荐答案

您可以用一帧一帧动画,而不是gif动画得到类似的最终结果和缩放。 你需要提取的GIF的每一帧,并把各个帧的PNG(或其他支持的格式)的文件在res /绘制文件夹。创建并使用动画绘制:

You can use a frame by frame animation instead of animated gif to get similar end result and scaling. You need to extract each frame from the gif and place individual frames as png(or other supported format) files in the res/drawable folder. Create and use the animation drawable:

的http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html

要缩放动画, 检查这个。

有各种 scaleTypes 你可以用用这个方法来扩展你的动画。

There are various scaleTypes you can use to scale your animation using this method.

我知道这并不直接回答这个问题,但它会得到期望的最终结果。

I know this does not directly answers the question but it will give the desired end result.

阅读全文

相关推荐

最新文章