ビットマップ画像を文字列に変換して保存しました:
............
Bitmap photo = extras.getParcelable("data");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] b = baos.toByteArray();
String encodedImage = Base64.encodeToString(b, Base64.DEFAULT);
次に、文字列からビットマップを取得して、アクティビティの背景を次のように設定します。
byte[] temp = Base64.decode(encodedImage, Base64.DEFAULT);
Options options = new BitmapFactory.Options();
options.inScaled = false;
Bitmap bitmap = BitmapFactory.decodeByteArray(temp, 0,
temp.length, options);
Drawable d = new BitmapDrawable(getResources(), bitmap);
getWindow().setBackgroundDrawable(d);
すべて正常に動作しますが、画質が大幅に低下します。元の画像と同じ画質を維持するにはどうすればよいですか? ここで何か間違ったことをしたので、品質が低下しましたか?