I am developing custom camera app and I am trying to crop the bitmap before saving it to file.
int subPhoto= new int[reqWidth * reqHeight];
bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
bitmap.getPixels(subPhoto, 0, reqWidth, x, y, reqWidth, reqHeight);
bitmap = Bitmap.createBitmap(subPhoto, 0, reqWidth, reqWidth, reqHeight, Bitmap.Config.ARGB_8888);
Utils.saveBitmapToFile(bitmap);
But here I have a problem. This line int subPhoto= new int[reqWidth * reqHeight];
throwing outofmemory
error. Please let me know what I am doing wrong here