Unten ist der Code:Bitmap nicht auf Bildansicht
db.execSQL("CREATE TABLE IF NOT EXISTS SaveRetriveDB (IMG_ID INTEGER PRIMARY KEY,ImgTxt VARCHAR,StoreImg BLOB);");
db.execSQL("INSERT INTO SaveRetriveDB(ImgTxt,StoreImg)VALUES('txt','" + imageInByte + "')");
ByteArrayOutputStream stream = new ByteArrayOutputStream();
yourImage.compress(Bitmap.CompressFormat.PNG, 100, stream);
imageInByte = stream.toByteArray();
Cursor c = db.rawQuery("SELECT StoreImg FROM SaveRetriveDB where IMG_ID=2", null);
if (c.moveToNext()){
byte InByte[] = c.getBlob(c.getColumnIndex("StoreImg"));
Bitmap b1 = BitmapFactory.decodeByteArray(InByte, 0, InByte.length);
ImageView imageView1=(ImageView)findViewById(R.id.imageView_image);
imageView1.setImageBitmap(b1);
Toast.makeText(getApplicationContext(),InByte.toString(),Toast.LENGTH_SHORT).show();
}
Ich erhalte Byte-Array von DB, wenn man versucht, Byte-Array in Bild zu konvertieren, seine nicht funktioniert.
fügen Sie mehr Code und Informationen hinzu. – Ironman
Die ursprüngliche Frage muss bearbeitet werden, damit klar ist, was gefragt wird. Fügen Sie auch nützliche Informationen direkt zur Frage hinzu, nicht als Kommentare. – YoYo