0

I ve created my custom camera on my app.When I press capture button it saves the taken photo where I set it before.

Everything is fine for now. But the problem is the phone saves the photo as phones pixels I mean I want to 600x600 pixel but everyphone saves the picture as its camera defaults.

How can I solve this?

I use this example for my custom camera : link

Community
  • 1
  • 1
CompEng
  • 7,161
  • 16
  • 68
  • 122

1 Answers1

0

You must have to re size the bitmap of of your taken picture Like...

 Bitmap b = BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.length)
    profileImage.setImageBitmap(Bitmap.createScaledBitmap(b, 120, 120, false));

then after delete the previous image which one was taken by camera

Whats happen in your case:

1.) always custom camera returns it default preview size you can get your preview and picture size using the code and chooses as depending on your requirement.

Camera.Parameters params = mCamera.getParameters();
List<Camera.Size> sizes = params.getSupportedPreviewSizes();
List<Camera.Size> sizes = params.getSupportedPictureSizes()
GovindRathod
  • 867
  • 1
  • 8
  • 22
  • you can write it in your onActivityResult() when you come in your activity after taken the picture from camera. 1.) at there you have the URL of your taken picture right.. 2.) create the bitmap from your original picture after convert your original picture to resize – GovindRathod May 15 '14 at 08:52
  • thanks for answer, But how can I set the parameters of my camera like 300x300 pixels, I do not understand how to use? please help me – CompEng May 15 '14 at 11:20