Nachdem ein Bild aufgenommen und in Aktivität angezeigt wurde, wird es aufgrund der großen Bildgröße nicht in die Datenbank eingefügt. Ich muss wissen, wie man Bildgröße und Pixel komprimiert und verkleinert.So passen Sie die Bitmap nach dem Capture-Bild in meiner App an
try {
// Bitmap bitmap;
BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();
bitmap = BitmapFactory.decodeFile(f.getAbsolutePath(),
bitmapOptions);
imageView.setImageBitmap(bitmap);
String path = android.os.Environment
.getExternalStorageDirectory()
+ File.separator
+ "Phoenix" + File.separator + "default";
f.delete();
OutputStream outFile = null;
File file = new File(path, String.valueOf(System.currentTimeMillis()) + ".jpg");
try {
outFile = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.JPEG, 85, outFile);
outFile.flush();
outFile.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
Nicht sicher, ob OP ist bewusst, aber dies wird die Qualität der JPEG erheblich senken. – earthw0rmjim
Er möchte niedrige Bildgröße sowie niedrige Pixel. –