public void saveImg(View view){
BitmapDrawable bitmapDrawable= (BitmapDrawable) img.getDrawable();
Bitmap bitmap= bitmapDrawable.getBitmap();
//拿到图片
File file=Environment.getExternalStorageDirectory();
FileOutputStream fos= null;
try {
fos = new FileOutputStream(file+"/1.png");
bitmap.compress(Bitmap.CompressFormat.PNG,100,fos);
} catch (FileNotFoundException e) {
e.printStackTrace();
}finally {
if(fos!=null){
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}