将图片进行压缩
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;
// }
// *
// */
// 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;
// }
相关文章推荐
- Linux使用备忘录
- UVA 11584 Partitioning by Palindromes 区间dp
- 欢迎使用CSDN-markdown编辑器
- nginx历程??
- Codeforces 246A-Buggy Sorting【模拟】
- 足底筋膜炎
- POJ 3249-Test for Job(拓扑排序&&DP)
- TextView属性大全【转】
- quartz CronExpression表达式
- iOS App被拒原因
- c语言1(基础)
- S-DES子密钥产生
- GDOI2016再次滚粗记
- Java 类中各成分加载顺序 和 内存中的存放位置
- Git远程操作详解
- untiy 3d ShaderLab_第6章_VertexLit渲染路径_2_顶点照明和Unity存放光源的第一种方式
- Android逆向
- iOS xib创建UIScrollView不滑动问题解决
- NFS脚本搭建
- 多线程并发库高级应用 之 使用java5中同步技术的3个面试题