您的位置:首页 > 其它

将图片进行压缩

2016-05-03 19:29 381 查看
// * EditText中可以接收的图片(要转化为SpannableString)

// *

// */

// private SpannableString getBitmapMime(Bitmap pic, Uri uri) {

// int imgWidth = pic.getWidth();

// int imgHeight = pic.getHeight();

// // 只对大尺寸图片进行下面的压缩,小尺寸图片使用原图

// if (imgWidth >= mInsertedImgWidth) {

// float scale = (float) mInsertedImgWidth / imgWidth;

// Matrix mx = new Matrix();

// mx.setScale(scale, scale);

// pic = Bitmap.createBitmap(pic, 0, 0, imgWidth, imgHeight, mx, true);

// }

// String smile = uri.getPath();

// SpannableString ss = new SpannableString(smile);

// ImageSpan span = new ImageSpan(this, pic);

// ss.setSpan(span, 0, smile.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

// return ss;

// }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: