2012-08-06 50 views

回答

1

我寫了這段代碼從url接收圖片。如果你檢查這個鏈接,它告訴你如何將它保存在SD卡上Store Bitmap image to SD Card in Android

private Bitmap getBitmap(String str, Options options) { 
    // TODO Auto-generated method stub 
    Bitmap bm = null; 
    InputStream inStream = null; 
    try { 
     inStream = HttpConnection(str); 
     bm = BitmapFactory.decodeStream(inStream, null, options); 
     inStream.close(); 
    } catch (IOException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } 

    return bm; 
} 
+0

我應該通過什麼樣的選擇方法? – user1531240 2012-08-06 09:15:45

+0

我將url傳輸到位圖,但我沒有將其壓縮到文件 我發現位圖的寬度和高度均爲-1 我該怎麼辦? – user1531240 2012-08-06 12:00:30

相關問題