createScaledBitmap参数

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
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值