title: Android: How to save a preview frame as jpeg image?
body: <p>I would like to save a preview frame as a jpeg image.</p>
  
  <p>I have tried to write the following code:</p>
  
  <pre><code>public void onPreviewFrame(byte[] _data, Camera _camera)
  {
      if(settings.isRecording())
      {
          Camera.Parameters params = _camera.getParameters();
          params.setPictureFormat(PixelFormat.JPEG);
          _camera.setParameters(params);
          String path = "ImageDir" + frameCount;
          fileRW.setPath(path);
          fileRW.WriteToFile(_data);
          frameCount++;
      }
  }
  </code></pre>
  
  <p>but it's not possible to open a saved file as a jpeg image. Does anyone know how to save preview frames as jpeg images?</p>
  
  <p>Thanks</p>