对图片的截取,按照1/3比例:
int bmpWidth = bitmap.getWidth();
int bmpHeight = bitmap.getHeight();
int h = bmpHeight * mScreenWidth / bmpWidth;
//截图(按1/3比例)
int resultHeight = (Integer) (bmpWidth * 210/320);
bitmap= Bitmap.createBitmap(bitmap, 0, bmpHeight / 3
- resultHeight / 2, bmpWidth, resultHeight);
int hh = (Integer) (mScreenWidth * resultHeight / bmpWidth);
bitmap= Bitmap.createScaledBitmap(bitmap, mScreenWidth, hh, false);
int bmpWidth = bitmap.getWidth();
int bmpHeight = bitmap.getHeight();
int h = bmpHeight * mScreenWidth / bmpWidth;
//截图(按1/3比例)
int resultHeight = (Integer) (bmpWidth * 210/320);
bitmap= Bitmap.createBitmap(bitmap, 0, bmpHeight / 3
- resultHeight / 2, bmpWidth, resultHeight);
int hh = (Integer) (mScreenWidth * resultHeight / bmpWidth);
bitmap= Bitmap.createScaledBitmap(bitmap, mScreenWidth, hh, false);