I need to do the following:
- Get a picture using the camera from Android…
- Remove the background from the image and put in another background
- save it
Im doing those 3 steps fine…
The problem is the image is saved in a small size (160 x 120).
When i get the result from camera i do this:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
Log.i("Test", "Width: " + photo.getWidth() + " Height: " + photo.getHeight());
It returns
Width: 160 Height: 120
The image that I am getting from “data” variable is 1280 x 960…
If I use
background= Bitmap.createScaledBitmap(background, 1280, 960, false);
The image I get as bad quality…
How can I get the bitmap in the right size?!
Try writing out the image to a file and then returning the filename as the result: