将图片进行压缩

来源:互联网 发布:网络投标技术方案模板 编辑:程序博客网 时间:2024/05/16 05:19
// * 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;
// }
0 0
原创粉丝点击