Note that there are some explanatory texts on larger screens.

plurals
  1. POCan Android camera intent specify pictureSize?
    text
    copied!<p>From my current search, Android camera intent can not specify pictureSize. Since my app needs to be fast, I do not want to save a large size picture in sd card, then load it to a small size of Bitmap. I think it takes time. Plus, I need a gray scale image, rather than a color Bitmap. I know how to convert them, but again it takes time. </p> <p>I plan to take a picture at a specified size, and directly process the Y part (gray scale) in the YUV data in the memory.</p> <p>So does that mean I have to write my own camera app using camera API?</p> <p>Are there any good examples? Many examples I checked so far often do not consider autofocus. I add features in XML file: </p> <pre><code>&lt;uses-feature android:name="android.hardware.camera" /&gt; &lt;uses-feature android:name="android.hardware.camera.autofocus" /&gt; </code></pre> <p>I add the auto focus mode to the camera parameter.</p> <pre><code>parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO); </code></pre> <p>But it does not work. So I add autofocus command immediately before camera press button.</p> <pre><code>preview.camera.autoFocus(myAutoFocusCallback); preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback); </code></pre> <p>But the autofocus takes some time, and until the preview becomes clear, the take pictures has been performed. Plus, I also want it to autofocus even if I do not press the camera button. How can I put autofocus nicely in it?</p> <p>Are there any good examples? Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload