2014-04-16 112 views
0

當我節省SD卡則圖像質量損失圖像質量損失

這裏的圖像是我同

Bitmap bitmap2 = extras.getParcelable("data"); 
File file = new File(path); 
FileOutputStream fOut = new FileOutputStream(file); 
bitmap2.compress(Bitmap.CompressFormat.JPEG, 100, fOut); 
fOut.flush(); 
fOut.close(); 
+0

什麼是bitmap2? –

+0

它使用Android默認作物 com.android.camera.action.CROP –

+1

for croup只是使用foloowing lib它很容易https://github.com/biokys/cropimage –

回答

1

代碼如果你不想失去質量,您的文件保存爲PNG這是一種無損壓縮格式:

bitmap2.compress(Bitmap.CompressFormat.PNG, 100, fOut); 
+0

我改變了它仍然是一個問題 –