0
我知道導入圖片到BMP是:的android InputStream的圖像
String t1="http://www.xxx.xxx/xx/xx.jpg";
URL TKs = new URL(t1);
InputStream Is= TKs.openStream();
Bitmap Bp = BitmapFactory.decodeStream(Is);
Is.close();
我也知道,將圖片轉換爲可存儲在SQL的格式:
is = resources.openRawResource(R.drawable.xxx);
byte[] image2 = new byte[is.available()];
is.read(image2);
is.close();
我使用這兩種方法應該能達到我的目標:
String t1="http://www.xxx.xxx/xx/xx.jpg";
URL TKs = new URL(t1);
InputStream Is= TKs.openStream();
byte[] image2 = new byte[Is.available()];
//////////////////the image2 is NULL
Is.read(image2);
Is.close();
很顯然,我沒 我想李可以問我最後怎麼做?