Code example for Bitmap

Methods: createBitmapgetHeightgetWidth

0
	} 
 
	// 按钮点击放大函数 
	private void enlarge() { 
		try { 
			int bmpWidth = bitmap.getWidth();
			int bmpHeight = bitmap.getHeight();
 
			scaleWidth = (float) (scaleWidth * ZOOM_IN_SCALE);
			scaleHeight = (float) (scaleHeight * ZOOM_IN_SCALE);
 
			Matrix matrix = new Matrix();
			matrix.postScale(scaleWidth, scaleHeight);
			zoomedBMP = Bitmap.createBitmap(bitmap, 0, 0, bmpWidth, bmpHeight,
					matrix, true);
			imgView.setImageBitmap(zoomedBMP);
		} catch (Exception e) {
			// can't zoom because of memory issue, just ignore, no big deal 
		} 
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE