So, I have an image with a depth of 32 bits, but when I make it in the blob for my SQLite database and read it again with the following code, it has only 24-bit depth (the quality is lower, I want it to be that same quality). How do I get 32-bit depth?
DatabaseHandler db = new DatabaseHandler(camera.this); List<Database> contacts = db.getAllContacts(); for (Database contact : contacts) { BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options(); bmpFactoryOptions.inPreferredConfig = Bitmap.Config.ARGB_8888; //bmpFactoryOptions.inScaled = false; bmpFactoryOptions.outHeight = 240; bmpFactoryOptions.outWidth = 320; // decodes the blob back into a bitmap byte[] blob = contact.getMP(); ByteArrayInputStream inputStream = new ByteArrayInputStream(blob); Bitmap bitmap = BitmapFactory.decodeStream(inputStream); Bitmap scalen = Bitmap.createScaledBitmap(bitmap, 320, 240, false);
Coding source
Bitmap image15 = BitmapFactory.decodeResource(getResources(),R.drawable.wolverineklein); // convert bitmap to byte ByteArrayOutputStream stream = new ByteArrayOutputStream(); image15.compress(Bitmap.CompressFormat.JPEG, 100, stream); byte imageInByte1[] = stream.toByteArray();

source share