将图片进行压缩

// * 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;
// }

你可能感兴趣的:(图文混排)