2015-11-07 30 views
0

是否可以在android中查看插入的圖像?我應該使用哪個應用程序?我使用SQLite Debugger訪問數據庫內容並在圖像列中看到<BLOB>。有沒有辦法看到插入SQLite Debugger的圖片?如何查看插入真實設備的圖像?

+0

有什麼建議嗎? – Hoo

+0

請參閱此處的類似問題的答案:[http://stackoverflow.com/questions/7331310/how-to-store-image-as-blob-in-sqlite-how-to-retrieve-it](http:// stackoverflow.com/questions/7331310/how-to-store-image-as-blob-in-sqlite-how-to-retrieve-it) – lacs

+0

@VishalBhadani如果我只是想在真實的設備上查看插入的圖像,我應該怎麼做做 – Hoo

回答

0

只是查詢表

Cursor cur=your query; 
while(cur.moveToNext()) 
{ 
    byte[] photoblob=cur.getBlob(index of blob column); 
} 


現在轉換的byte []的照片圖像:

ByteArrayInputStream imagestrm = new ByteArrayInputStream(photoblob); 
Bitmap img= BitmapFactory.decodeStream(imagestrm); 

現在,您可以設置位圖ImageView的。

我希望你能明白我的觀點。

+0

所以當它已經插入,我怎麼看? – Hoo