标签:android style blog color 使用 width
使用Martix(android.graphics.Matrix)类中的postScale()方法结合Bitmap来实现缩放图片的功能 Bitmap bmp = BitmapFactory.decodeResource(getResource(),R.drawalbe.icon1) int bmpwidth = bmp.getWidth(); int bmpheight = bmp.getHeight(); Matrix matrix = new Matrix(); matrix.postScale(width,height); Bitmap bm = Bitmap.createBitmap(bmp,0,0,bmpwidth,bmpheight ,matrix,true); imageView.setImageBitmap(bm); iv = (ImageView) findViewById(R.id.iv); iv.setImageResource(R.drawable.icon); onTouchEvent(): Matrix mtrx = iv.getImageMatrix(); mtrx.postScale(2, 2); iv.setImageMatrix(mtrx); iv.setScaleType(ScaleType.MATRIX); iv.invalidate();
使用Martix来实现缩放图片的功能,布布扣,bubuko.com
标签:android style blog color 使用 width
原文地址:http://www.cnblogs.com/niray/p/3815106.html