createScaledBitmap参数

来源:互联网 发布:虎豹骑吕布捏脸数据 编辑:程序博客网 时间:2024/05/19 01:31

API:

public static Bitmap createScaledBitmap (Bitmap src, int dstWidth, int dstHeight, boolean filter)

从当前存在的位图,按一定的比例创建一个新的位图。

参数

src        用来构建子集的源位图

                 dstWidth   新位图期望的宽度

                 dstHeight  新位图期望的高度

    返回值

             一个新的按比例变化的位图。

/** * 修改图片的大小(从当前存在的位图,按一定的比例创建一个新的位图)<br> * 方 法 名:createScaledBitmap <br> * 创 建 人: <br> * 创建时间:2016-6-7 上午9:14:47 <br> * 修 改 人: <br> * 修改日期: <br> * @param bitmap 用来构建子集的源位图 * @param iconWidth 新位图期望的宽度 * @param iconHeight 新位图期望的高度 * @param filter 未知 * @return Bitmap 一个新的按比例变化的位图。 */public static Bitmap createScaledBitmap(Bitmap bitmap, int iconWidth, int iconHeight, boolean filter) {Bitmap bitmap2;try {bitmap2 = Bitmap.createScaledBitmap(bitmap, iconWidth, iconHeight, filter);} catch (OutOfMemoryError localOutOfMemoryError) {gc();bitmap2 = Bitmap.createScaledBitmap(bitmap, iconWidth, iconHeight, filter);}return bitmap2;}


1 1
原创粉丝点击