源码介绍Android快速开发必备的11个辅助类,其中10个来自张红阳的博客,1个是我平时的积累,复制粘贴到你的项目中,就可以使用了直接添加包名,可以提高开发速度。源码运行截图源码片段//缩放/裁剪图片publicstaticBitmapzoomImg(Bitmapbm,intnewWidth,intnewHeight){//获取图片的宽高intwidth=bm.getWidth();intheight=bm.getHeight();//计算缩放比例floatscaleWidth=((float)newWidth)/width;floatscaleHeight=((float)newHeight)/高度;//获取要缩放的矩阵参数Matrixmatrix=newMatrix();matrix.postScale(scaleWidth,scaleHeight);//获取新图片Bitmapnewbm=Bitmap.createBitmap(bm,0,0,width,height,matrix,true);返回newbm;}下载地址:http://down.51cto.com/data/1971447
