开发者

How to resize an image without stretching?

I have a bitmap of 128*128 size. I want to make it of size 256*256. But I don't want to stretch the image. Instead, my old image should be placed at the center of the new image and remaining pixels should be filled with a certain color, for example white.

How can I do this开发者_StackOverflow中文版?


ImageView have setScaleType(ScaleType type) method.

When ScaleType is http://developer.android.com/reference/android/widget/ImageView.ScaleType.html

Try to play with it. Good luck!!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜