缩略图 定义imageview的宽高为原图的1/6就可以 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Quote: 引用 1 楼 hjywyj 的回复:定义imageview的宽高为原图的1/6就可以能给个demo吗?谢谢 压缩尺寸这个简单,点击图片撑大这个也简单,保存一份原始,和压缩的,判断点击事件,显示层布局全屏最大展开原图片。压缩 //尺寸 public static Bitmap ResizeBitmap(Bitmap bitmap, int newWidth) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float temp = ((float) height) / ((float) width); int newHeight = (int) ((newWidth) * temp); float scaleWidth = ((float) newWidth) / width; float scaleHeight = ((float) newHeight) / height; Matrix matrix = new Matrix(); // resize the bit map matrix.postScale(scaleWidth, scaleHeight); // matrix.postRotate(45); Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true); bitmap.recycle(); return resizedBitmap; }点击事件onclick+层布局+图片宽高fill match之类 Quote: 引用 3 楼 abcmsnet 的回复:能给个demo吗?谢谢 Gallery切换图片的时候怎么禁止边界回弹 Android AT指令发送 android Wifi 如何设置程序的优先级,防止被杀毒软件清理 Android程序能反编译吗? 大家说说现在android,symbian,wm,j2me哪个更有前途 SurfaceView黑屏问题 关于android 软件测试的问题 如何设置背景透明 如何使用webview像UC浏览器一样控制前进后退按钮 微信类app的网络通信部分是怎样的实现? 有关android setPixel方法的疑问
压缩
//尺寸
public static Bitmap ResizeBitmap(Bitmap bitmap, int newWidth) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
float temp = ((float) height) / ((float) width);
int newHeight = (int) ((newWidth) * temp);
float scaleWidth = ((float) newWidth) / width;
float scaleHeight = ((float) newHeight) / height;
Matrix matrix = new Matrix();
// resize the bit map
matrix.postScale(scaleWidth, scaleHeight);
// matrix.postRotate(45);
Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
bitmap.recycle();
return resizedBitmap;
}
点击事件onclick+层布局+图片宽高fill match之类