Bitmap b = Bitmap.createBitmap( picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas( b );
picture.draw( c );
FileOutputStream fos = null;
try {
fos = new FileOutputStream( "/sdcard/yahoo_" +
System.currentTimeMillis() + ".jpg" ); if ( fos != null )
{
b.compress(Bitmap.CompressFormat.JPEG, 90, fos ); fos.close();
} } catch( Exception e )
{
//...
}
}
});
标签:Picture,Canvas,picture,专成,fos,Bitmap,FileOutputStream,null,sd
From: https://blog.51cto.com/u_16166892/6523962