图片解析
public void click(View v){
Options opt = new Options();
opt.inJustDecodeBounds = true;
BitmapFactory.decodeFile("xx.jpg", opt);
int imageWidth = opt.outWidth;
int imageHeight = opt.outWeight;
Display dp = getWindowManager().getDefaultDisplay();
int screenWidth = dp.getWidth();
int screenHeight = dp.getHeight();
opt.insampleSize = scale;
opt.inJustDecodeBounds = false;
BitMap bm = BitMapFactory.decodeFile("xx.jpg", opt);
iv.setImageBitmap(bm);
}
public void click(View v){
Bitmap bmSrc = BitmapFactory.decodeFile("xx.jpg");
Bitmap bmCopy = BitMap.createBitmap(brmSrc.getWidth(), bmSrc.getHeight(), bmSrc.getConfig());
Paint paint = new Paint();
Canvas canvas = new Canvas(bmCopy);
Matrix mt = new Matrix();
mt.setTranslate(20, 40);
mt.setScale(2, 0.5f);
mt.setRotate(45);
mt.setScale(-1, 1);
mt.postTranslate(bmCopy.getWidth(),0);
mt.setScale(1,-1);
mt.postTranslate(0, bmCopy.getHeight());
canvas.drawBitmap(bmSrc, mt, paint);
canvas.drawLine(10, 10, 10, 10, paint);
}